forked from trent_larson/crowd-funder-for-time-pwa
Fix InviteOneAcceptView migration fence; remove USE_DEXIE_DB dependency
- Remove USE_DEXIE_DB import from app.ts constants - Update InviteOneAcceptView to use PlatformServiceMixin pattern - Remove legacy Dexie database access code - Move WORKER_ONLY_DATABASE_IMPLEMENTATION.md to doc/ directory - Remerge changes in router/index.ts Fixes Electron build failure caused by missing USE_DEXIE_DB export.
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
<code>timesafari://{{ formattedPath }}</code>
|
||||
<div class="debug-info">
|
||||
<h4>Parameters:</h4>
|
||||
<pre>{{ JSON.stringify($route.params, null, 2) }}</pre>
|
||||
<pre>{{ JSON.stringify(route.params, null, 2) }}</pre>
|
||||
<h4>Query:</h4>
|
||||
<pre>{{ JSON.stringify($route.query, null, 2) }}</pre>
|
||||
<pre>{{ JSON.stringify(route.query, null, 2) }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,104 +31,79 @@
|
||||
<h2>Supported Deep Links</h2>
|
||||
<ul>
|
||||
<li v-for="(routeItem, index) in validRoutes" :key="index">
|
||||
<code>timesafari://{{ routeItem }}/:id</code>
|
||||
<code>timesafari://{{ routeItem }}/:{{ deepLinkSchemaKeys[routeItem] }}</code>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
// TODO: Testing Required - Vue 3 to Options API + PlatformServiceMixin Migration
|
||||
// Priority: Medium | Migrated: 2025-07-06 | Author: Matthew Raymer
|
||||
//
|
||||
// MIGRATION DETAILS: Converted from Vue 3 Composition API to Options API for PlatformServiceMixin
|
||||
// - Replaced logConsoleAndDb() with this.$logAndConsole()
|
||||
// - Converted computed properties to getters
|
||||
// - Converted onMounted to mounted() lifecycle hook
|
||||
//
|
||||
// TESTING NEEDED:
|
||||
// 1. Test invalid deep link triggering (easy to test)
|
||||
// 2. Verify error logging works correctly
|
||||
// 3. Test error page display and navigation
|
||||
// 4. Test "Report Issue" functionality
|
||||
//
|
||||
// Test URL: timesafari://invalid/path?param=test
|
||||
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
import { VALID_DEEP_LINK_ROUTES } from "../interfaces/deepLinks";
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { VALID_DEEP_LINK_ROUTES, deepLinkSchemas } from "../interfaces/deepLinks";
|
||||
import { logConsoleAndDb } from "../db/databaseUtil";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
|
||||
@Component({
|
||||
mixins: [PlatformServiceMixin],
|
||||
})
|
||||
export default class DeepLinkErrorView extends Vue {
|
||||
/** Current route instance */
|
||||
$route!: RouteLocationNormalizedLoaded;
|
||||
/** Router instance for navigation */
|
||||
$router!: Router;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
// an object with the route as the key and the first param name as the value
|
||||
const deepLinkSchemaKeys = Object.fromEntries(
|
||||
Object.entries(deepLinkSchemas).map(([route, schema]) => {
|
||||
const param = Object.keys(schema.shape)[0];
|
||||
return [route, param];
|
||||
})
|
||||
);
|
||||
|
||||
validRoutes = VALID_DEEP_LINK_ROUTES;
|
||||
// Extract error information from query params
|
||||
const errorCode = computed(
|
||||
() => (route.query.errorCode as string) || "UNKNOWN_ERROR",
|
||||
);
|
||||
const errorMessage = computed(
|
||||
() =>
|
||||
(route.query.errorMessage as string) ||
|
||||
"The deep link you followed is invalid or not supported.",
|
||||
);
|
||||
const originalPath = computed(() => route.query.originalPath as string);
|
||||
const validRoutes = VALID_DEEP_LINK_ROUTES;
|
||||
|
||||
// Extract error information from query params
|
||||
get errorCode(): string {
|
||||
return (this.$route.query.errorCode as string) || "UNKNOWN_ERROR";
|
||||
}
|
||||
// Format the path and include any parameters
|
||||
const formattedPath = computed(() => {
|
||||
if (!originalPath.value) return "";
|
||||
const path = originalPath.value.replace(/^\/+/, "");
|
||||
|
||||
get errorMessage(): string {
|
||||
return (
|
||||
(this.$route.query.message as string) ||
|
||||
"The deep link you followed is invalid or not supported."
|
||||
);
|
||||
}
|
||||
// Log for debugging
|
||||
logger.log(
|
||||
"[DeepLinkError] Original Path:",
|
||||
originalPath.value,
|
||||
"Route Params:",
|
||||
route.params,
|
||||
"Route Query:",
|
||||
route.query,
|
||||
);
|
||||
|
||||
get originalPath(): string {
|
||||
return this.$route.query.originalPath as string;
|
||||
}
|
||||
return path;
|
||||
});
|
||||
|
||||
// Format the path and include any parameters
|
||||
get formattedPath(): string {
|
||||
if (!this.originalPath) return "";
|
||||
const path = this.originalPath.replace(/^\/+/, "");
|
||||
// Navigation methods
|
||||
const goHome = () => router.replace({ name: "home" });
|
||||
const reportIssue = () => {
|
||||
// Open a support form or email
|
||||
window.open(
|
||||
"mailto:support@timesafari.app?subject=Invalid Deep Link&body=" +
|
||||
encodeURIComponent(
|
||||
`I encountered an error with a deep link: timesafari://${originalPath.value}\nError: ${errorMessage.value}`,
|
||||
),
|
||||
);
|
||||
};
|
||||
|
||||
// Log for debugging
|
||||
logger.log(
|
||||
"[DeepLinkError] Original Path:",
|
||||
this.originalPath,
|
||||
"Route Params:",
|
||||
this.$route.params,
|
||||
"Route Query:",
|
||||
this.$route.query,
|
||||
);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
// Navigation methods
|
||||
goHome(): void {
|
||||
this.$router.replace({ name: "home" });
|
||||
}
|
||||
|
||||
reportIssue(): void {
|
||||
// Open a support form or email
|
||||
window.open(
|
||||
"mailto:support@timesafari.app?subject=Invalid Deep Link&body=" +
|
||||
encodeURIComponent(
|
||||
`I encountered an error with a deep link: timesafari://${this.originalPath}\nError: ${this.errorMessage}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Log the error for analytics
|
||||
async mounted(): Promise<void> {
|
||||
this.$logAndConsole(
|
||||
`[DeepLink] Error page displayed for path: ${this.originalPath}, code: ${this.errorCode}, params: ${JSON.stringify(this.$route.params)}`,
|
||||
true,
|
||||
);
|
||||
}
|
||||
}
|
||||
// Log the error for analytics
|
||||
onMounted(() => {
|
||||
logConsoleAndDb(
|
||||
`[DeepLinkError] Error page displayed for path: ${originalPath.value}, code: ${errorCode.value}, params: ${JSON.stringify(route.params)}, query: ${JSON.stringify(route.query)}`,
|
||||
true,
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user