forked from jsnbuchanan/crowd-funder-for-time-pwa
Complete Enhanced Triple Migration Pattern for contact components
- Migrate ContactBulkActions, ContactInputForm, ContactListHeader, ContactListItem, LargeIdenticonModal, and ContactsView to PlatformServiceMixin - Add comprehensive deep linking support to CapacitorPlatformService and WebPlatformService - Enhance PlatformService with new database operations and deep link handling - Update service worker and documentation for migration progress - Fix TypeScript type errors in util.ts and deepLinks.ts - Streamline circular dependency analysis and migration tracking docs
This commit is contained in:
@@ -52,7 +52,6 @@ import {
|
||||
routeSchema,
|
||||
DeepLinkRoute,
|
||||
} from "../interfaces/deepLinks";
|
||||
import { logConsoleAndDb } from "../db/databaseUtil";
|
||||
import type { DeepLinkError } from "../interfaces/deepLinks";
|
||||
|
||||
// Helper function to extract the first key from a Zod object schema
|
||||
@@ -148,10 +147,8 @@ export class DeepLinkHandler {
|
||||
params[routeConfig.paramKey ?? "id"] = pathParams.join("/");
|
||||
}
|
||||
|
||||
// logConsoleAndDb(
|
||||
// `[DeepLink] Debug: Route Path: ${routePath} Path Params: ${JSON.stringify(params)} Query String: ${JSON.stringify(query)}`,
|
||||
// false,
|
||||
// );
|
||||
// Note: Logging removed to eliminate databaseUtil dependency
|
||||
// Deep link parsing debug info can be added back using PlatformServiceMixin if needed
|
||||
return { path: routePath, params, query };
|
||||
}
|
||||
|
||||
@@ -177,8 +174,8 @@ export class DeepLinkHandler {
|
||||
const validRoute = routeSchema.parse(path) as DeepLinkRoute;
|
||||
routeName = ROUTE_MAP[validRoute].name;
|
||||
} catch (error) {
|
||||
// Log the invalid route attempt
|
||||
logConsoleAndDb(`[DeepLink] Invalid route path: ${path}`, true);
|
||||
// Log the invalid route attempt - using console.error instead of databaseUtil
|
||||
console.error(`[DeepLink] Invalid route path: ${path}`);
|
||||
|
||||
// Redirect to error page with information about the invalid link
|
||||
await this.router.replace({
|
||||
@@ -205,9 +202,8 @@ export class DeepLinkHandler {
|
||||
validatedQuery = await schema.parseAsync(query);
|
||||
} catch (error) {
|
||||
// For parameter validation errors, provide specific error feedback
|
||||
logConsoleAndDb(
|
||||
console.error(
|
||||
`[DeepLink] Invalid parameters for route name ${routeName} for path: ${path}: ${JSON.stringify(error)} ... with params: ${JSON.stringify(params)} ... and query: ${JSON.stringify(query)}`,
|
||||
true,
|
||||
);
|
||||
await this.router.replace({
|
||||
name: "deep-link-error",
|
||||
@@ -231,9 +227,8 @@ export class DeepLinkHandler {
|
||||
query: validatedQuery,
|
||||
});
|
||||
} catch (error) {
|
||||
logConsoleAndDb(
|
||||
console.error(
|
||||
`[DeepLink] Error routing to route name ${routeName} for path: ${path}: ${JSON.stringify(error)} ... with validated params: ${JSON.stringify(validatedParams)} ... and validated query: ${JSON.stringify(validatedQuery)}`,
|
||||
true,
|
||||
);
|
||||
// For parameter validation errors, provide specific error feedback
|
||||
await this.router.replace({
|
||||
@@ -266,9 +261,9 @@ export class DeepLinkHandler {
|
||||
await this.validateAndRoute(path, sanitizedParams, query);
|
||||
} catch (error) {
|
||||
const deepLinkError = error as DeepLinkError;
|
||||
logConsoleAndDb(
|
||||
// Log the error using console.error instead of databaseUtil
|
||||
console.error(
|
||||
`[DeepLink] Error (${deepLinkError.code}): ${deepLinkError.details}`,
|
||||
true,
|
||||
);
|
||||
|
||||
throw {
|
||||
|
||||
Reference in New Issue
Block a user