mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Add temporary gateways
This commit is contained in:
parent
3e3712efb3
commit
a1c9ceae6b
@ -1,6 +1,6 @@
|
||||
import log from "@/next/log";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import { boxSealOpen, toB64 } from "@ente/shared/crypto/internal/libsodium";
|
||||
import log from "@/next/log";
|
||||
import castGateway from "@ente/shared/network/cast";
|
||||
import LargeType from "components/LargeType";
|
||||
import _sodium from "libsodium-wrappers";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Remote, wrap } from "comlink";
|
||||
import log from "@/next/log";
|
||||
import { Remote, wrap } from "comlink";
|
||||
|
||||
export class ComlinkWorker<T extends new () => InstanceType<T>> {
|
||||
public remote: Promise<Remote<InstanceType<T>>>;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { getFileNameSize } from "@/next/file";
|
||||
import { addLogLine } from "@ente/shared/logging";
|
||||
import { getFileNameSize } from "@ente/shared/logging/web";
|
||||
import { logError } from "@ente/shared/sentry";
|
||||
import { FILE_READER_CHUNK_SIZE, MULTIPART_PART_SIZE } from "constants/upload";
|
||||
import {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { getFileNameSize } from "@/next/file";
|
||||
import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import { addLogLine } from "@ente/shared/logging";
|
||||
import { getFileNameSize } from "@ente/shared/logging/web";
|
||||
import { logError } from "@ente/shared/sentry";
|
||||
import { Remote } from "comlink";
|
||||
import { FILE_READER_CHUNK_SIZE } from "constants/upload";
|
||||
|
@ -1,8 +1,7 @@
|
||||
import ElectronAPIs from "@/next/electron";
|
||||
import { convertBytesToHumanReadable } from "@/next/file";
|
||||
import { convertBytesToHumanReadable, getFileNameSize } from "@/next/file";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import { addLogLine } from "@ente/shared/logging";
|
||||
import { getFileNameSize } from "@ente/shared/logging/web";
|
||||
import { logError } from "@ente/shared/sentry";
|
||||
import { FILE_TYPE } from "constants/file";
|
||||
import { BLACK_THUMBNAIL_BASE64 } from "constants/upload";
|
||||
|
@ -24,10 +24,10 @@ import UIService from "./uiService";
|
||||
import UploadService from "./uploadService";
|
||||
import uploader from "./uploader";
|
||||
|
||||
import { getFileNameSize } from "@/next/file";
|
||||
import { getDedicatedCryptoWorker } from "@ente/shared/crypto";
|
||||
import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker";
|
||||
import { addLogLine } from "@ente/shared/logging";
|
||||
import { getFileNameSize } from "@ente/shared/logging/web";
|
||||
import { ComlinkWorker } from "@ente/shared/worker/comlinkWorker";
|
||||
import { Remote } from "comlink";
|
||||
import { UPLOAD_RESULT, UPLOAD_STAGES } from "constants/upload";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { getFileNameSize } from "@/next/file";
|
||||
import { addLogLine } from "@ente/shared/logging";
|
||||
import { getFileNameSize } from "@ente/shared/logging/web";
|
||||
import { logError } from "@ente/shared/sentry";
|
||||
import { NULL_EXTRACTED_METADATA } from "constants/upload";
|
||||
import * as ffmpegService from "services/ffmpeg/ffmpegService";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import ElectronAPIs from "@/next/electron";
|
||||
import { getFileNameSize } from "@ente/shared/logging/web";
|
||||
import { getFileNameSize } from "@/next/file";
|
||||
import { FILE_READER_CHUNK_SIZE, PICKED_UPLOAD_TYPE } from "constants/upload";
|
||||
import isElectron from "is-electron";
|
||||
import { getElectronFileStream, getFileStream } from "services/readerService";
|
||||
|
@ -1,3 +1,4 @@
|
||||
import ElectronAPIs from "@/next/electron";
|
||||
import { setRecoveryKey } from "@ente/accounts/api/user";
|
||||
import { logError } from "@ente/shared/sentry";
|
||||
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
|
||||
@ -7,7 +8,6 @@ import { getActualKey } from "@ente/shared/user";
|
||||
import { KeyAttributes } from "@ente/shared/user/types";
|
||||
import isElectron from "is-electron";
|
||||
import ComlinkCryptoWorker from ".";
|
||||
import ElectronAPIs from "@/next/electron";
|
||||
import { addLogLine } from "../logging";
|
||||
|
||||
const LOGIN_SUB_KEY_LENGTH = 32;
|
||||
|
@ -1,33 +1,9 @@
|
||||
import { inWorker, isDevBuild } from "@/next/env";
|
||||
import { logToDisk } from "@/next/log";
|
||||
import { workerBridge } from "@/next/worker/worker-bridge";
|
||||
import { logError } from "@ente/shared/sentry";
|
||||
import log from "@/next/log";
|
||||
|
||||
export function addLogLine(
|
||||
log: string | number | boolean,
|
||||
msg: string | number | boolean,
|
||||
...optionalParams: (string | number | boolean)[]
|
||||
) {
|
||||
try {
|
||||
const completeLog = [log, ...optionalParams].join(" ");
|
||||
if (isDevBuild) {
|
||||
console.log(completeLog);
|
||||
}
|
||||
if (inWorker()) {
|
||||
workerBridge
|
||||
.logToDisk(completeLog)
|
||||
.catch((e) =>
|
||||
console.error(
|
||||
"Failed to log a message from worker",
|
||||
e,
|
||||
"\nThe message was",
|
||||
completeLog,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
logToDisk(completeLog);
|
||||
}
|
||||
} catch (e) {
|
||||
logError(e, "failed to addLogLine", undefined, true);
|
||||
// ignore
|
||||
}
|
||||
const completeLog = [msg, ...optionalParams].join(" ");
|
||||
log.info(completeLog);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user