Browse Source

fix: streamline deep link handling and testing

- Add force-stop before deep link execution
- Remove URL encoding for deep link paths
- Simplify deep link schema definitions
- Remove unused route mappings
- Add proper app package name for force-stop

Technical Changes:
- Remove redundant URL encoding for deep link paths
- Add force-stop for app.timesafari.app before deep links
- Add sleep delay after force-stop for reliability
- Remove unused route mappings from routeMap
- Simplify DID schema to only require id field

This improves deep link testing reliability by properly
resetting app state before each test and simplifies the
deep link handling code by removing unused routes and
redundant URL encoding.
pull/127/head
Matthew Raymer 2 days ago
parent
commit
a40420af16
  1. 7
      src/services/deepLinks.ts
  2. 41
      src/types/deepLinks.ts

7
src/services/deepLinks.ts

@ -110,15 +110,10 @@ export class DeepLinkHandler {
query: Record<string, string>,
): Promise<void> {
const routeMap: Record<string, string> = {
claim: "claim",
"claim-cert": "claim-cert",
"claim-add-raw": "claim-add-raw",
"contact-edit": "contact-edit",
"contact-import": "contact-import",
project: "project",
"invite-one-accept": "invite-one-accept",
"offer-details": "offer-details",
"confirm-gift": "confirm-gift",
"contacts": "contacts",
did: "did"
};

41
src/types/deepLinks.ts

@ -36,40 +36,23 @@ export const baseUrlSchema = z.object({
// Parameter validation schemas for each route type
export const deepLinkSchemas = {
claim: z.object({
id: z.string().min(1),
view: z.enum(["details", "certificate", "raw"]).optional(),
"claim-cert": z.object({
id: z.string()
}),
contact: z.object({
did: z.string().regex(/^did:/),
action: z.enum(["edit", "import"]).optional(),
jwt: z.string().optional(),
}),
project: z.object({
id: z.string().min(1),
view: z.enum(["details", "edit"]).optional(),
"claim-add-raw": z.object({
id: z.string(),
claim: z.string().optional(),
claimJwtId: z.string().optional()
}),
invite: z.object({
jwt: z.string().min(1),
type: z.enum(["one", "many"]).optional(),
"contact-edit": z.object({
did: z.string()
}),
gift: z.object({
id: z.string().min(1),
action: z.enum(["confirm", "details"]).optional(),
"contacts": z.object({
contacts: z.string() // JSON string of contacts array
}),
offer: z.object({
id: z.string().min(1),
view: z.enum(["details"]).optional(),
}),
did: z.object({
id: z.string(),
}),
id: z.string()
})
};
export type DeepLinkParams = {

Loading…
Cancel
Save