forked from trent_larson/crowd-funder-for-time-pwa
Enhance commentary and logging.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Only the variables that start with VITE_ are seen in the application import.meta.env in Vue.
|
||||
|
||||
|
||||
# iOS doesn't like spaces in the app title.
|
||||
TIME_SAFARI_APP_TITLE="TimeSafari_Test"
|
||||
VITE_APP_SERVER=https://test.timesafari.app
|
||||
# This is the claim ID for actions in the BVC project.
|
||||
|
||||
@@ -7,6 +7,7 @@ export enum AppString {
|
||||
// This is used in titles and verbiage inside the app.
|
||||
// There is also an app name without spaces, for packaging in the package.json file used in the manifest.
|
||||
APP_NAME = "Time Safari",
|
||||
// iOS doesn't like spaces in the app title.
|
||||
APP_NAME_NO_SPACES = "TimeSafari",
|
||||
|
||||
PROD_ENDORSER_API_SERVER = "https://api.endorser.ch",
|
||||
|
||||
@@ -29,6 +29,7 @@ import { arrayBufferToBase64 } from "@/libs/crypto";
|
||||
|
||||
const randomBytes = crypto.getRandomValues(new Uint8Array(32));
|
||||
const secretBase64 = arrayBufferToBase64(randomBytes);
|
||||
console.log('secretBase64', secretBase64); // useful while we have multiple DBs activating (at least on web)
|
||||
|
||||
// Each migration can include multiple SQL statements (with semicolons)
|
||||
const MIGRATIONS = [
|
||||
|
||||
@@ -60,7 +60,7 @@ import {
|
||||
KeyMetaMaybeWithPrivate,
|
||||
} from "../interfaces/common";
|
||||
import { PlanSummaryRecord } from "../interfaces/records";
|
||||
import { logger } from "../utils/logger";
|
||||
import { logger, safeStringify } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
|
||||
/**
|
||||
@@ -437,19 +437,23 @@ export async function getHeaders(
|
||||
}
|
||||
headers["Authorization"] = "Bearer " + token;
|
||||
} catch (error) {
|
||||
// This rarely happens: we've seen it when they have account info but the
|
||||
// encryption secret got lost. But in most cases we want users to at
|
||||
// least see their feed -- and anything else that returns results for
|
||||
// anonymous users.
|
||||
|
||||
// We'll continue with an anonymous request... still want to show feed and other things, but ideally let them know.
|
||||
// This rarely happens: we've seen it when they have account info but the
|
||||
// encryption secret got lost.
|
||||
// Replicate this in Chrome: go to Storage and hit 'Clear site data'.
|
||||
// Check the util.ts retrieveFullyDecryptedAccount method where it calls simpleDecrypt.
|
||||
|
||||
// In most cases we want users to at least see their feed -- and anything
|
||||
// else that returns results for anonymous users.
|
||||
// We'll continue with an anonymous request... still want to show feed
|
||||
// and other things, but we need to let them know.
|
||||
logConsoleAndDb(
|
||||
"Something failed in getHeaders call (will proceed anonymously" +
|
||||
($notify ? " and notify user" : "") +
|
||||
"): " +
|
||||
// IntelliJ type system complains about getCircularReplacer() with: Argument of type '(obj: any, key: string, value: any) => any' is not assignable to parameter of type '(this: any, key: string, value: any) => any'.
|
||||
//JSON.stringify(error, getCircularReplacer()), // JSON.stringify(error) on a Dexie error throws another error about: Converting circular structure to JSON
|
||||
error,
|
||||
error + " - " + safeStringify(error),
|
||||
true,
|
||||
);
|
||||
if ($notify) {
|
||||
|
||||
@@ -605,7 +605,7 @@ export const retrieveFullyDecryptedAccount = async (
|
||||
dbAccount.values.length === 0 ||
|
||||
dbAccount.values[0].length === 0
|
||||
) {
|
||||
throw new Error("Account not found.");
|
||||
throw new Error("Account not found for did: " + activeDid);
|
||||
}
|
||||
const fullAccountData = databaseUtil.mapQueryResultToValues(
|
||||
dbAccount,
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<div class="flex justify-center text-center text-sm leading-tight mb-1">
|
||||
People {{ profileImageUrl ? "without your image" : "" }} see this
|
||||
<br />
|
||||
(if you've let them see your activity):
|
||||
(if you've let them see which posts are yours):
|
||||
</div>
|
||||
<div class="flex justify-center">
|
||||
<EntityIcon
|
||||
@@ -1573,24 +1573,25 @@ export default class AccountViewView extends Vue {
|
||||
* @throws Will notify the user if there is an export error.
|
||||
*/
|
||||
public async exportDatabase() {
|
||||
try {
|
||||
// Generate the blob from the database
|
||||
const blob = await this.generateDatabaseBlob();
|
||||
throw new Error("Not implemented");
|
||||
// try {
|
||||
// // Generate the blob from the database
|
||||
// const blob = await this.generateDatabaseBlob();
|
||||
|
||||
// Create a temporary URL for the blob
|
||||
this.downloadUrl = this.createBlobURL(blob);
|
||||
// // Create a temporary URL for the blob
|
||||
// this.downloadUrl = this.createBlobURL(blob);
|
||||
|
||||
// Trigger the download
|
||||
this.downloadDatabaseBackup(this.downloadUrl);
|
||||
// // Trigger the download
|
||||
// this.downloadDatabaseBackup(this.downloadUrl);
|
||||
|
||||
// Notify the user that the download has started
|
||||
this.notifyDownloadStarted();
|
||||
// // Notify the user that the download has started
|
||||
// this.notifyDownloadStarted();
|
||||
|
||||
// Revoke the temporary URL -- after a pause to avoid DuckDuckGo download failure
|
||||
setTimeout(() => URL.revokeObjectURL(this.downloadUrl), 1000);
|
||||
} catch (error) {
|
||||
this.handleExportError(error);
|
||||
}
|
||||
// // Revoke the temporary URL -- after a pause to avoid DuckDuckGo download failure
|
||||
// setTimeout(() => URL.revokeObjectURL(this.downloadUrl), 1000);
|
||||
// } catch (error) {
|
||||
// this.handleExportError(error);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -102,8 +102,7 @@ Raymer * @version 1.0.0 */
|
||||
class="text-md font-bold bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white mt-2 px-2 py-3 rounded-md"
|
||||
@click="showNameThenIdDialog()"
|
||||
>
|
||||
Show them {{ PASSKEYS_ENABLED ? "default" : "your" }} identifier
|
||||
info
|
||||
Show them your identification info
|
||||
</button>
|
||||
</div>
|
||||
<UserNameDialog ref="userNameDialog" />
|
||||
@@ -683,7 +682,7 @@ export default class HomeView extends Vue {
|
||||
group: "alert",
|
||||
type: "warning",
|
||||
title: "Feed Loading Issue",
|
||||
text: "Some feed data may be unavailable. Pull to refresh.",
|
||||
text: "Some feed data may be unavailable. Try refreshing the page.",
|
||||
},
|
||||
5000,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user