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.
This commit is contained in:
Matthew Raymer
2025-03-10 07:52:21 +00:00
parent 21244efa73
commit a40420af16
2 changed files with 15 additions and 37 deletions

View File

@@ -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"
};

View File

@@ -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(),
}),
invite: z.object({
jwt: z.string().min(1),
type: z.enum(["one", "many"]).optional(),
}),
gift: z.object({
id: z.string().min(1),
action: z.enum(["confirm", "details"]).optional(),
}),
offer: z.object({
id: z.string().min(1),
view: z.enum(["details"]).optional(),
}),
did: z.object({
"claim-add-raw": z.object({
id: z.string(),
claim: z.string().optional(),
claimJwtId: z.string().optional()
}),
"contact-edit": z.object({
did: z.string()
}),
"contacts": z.object({
contacts: z.string() // JSON string of contacts array
}),
did: z.object({
id: z.string()
})
};
export type DeepLinkParams = {