ATL-2026-019architectureexperimental

The link opened the app. Why did the journey still break?

A deep link displayed the right profile, but the first Back left the app. We examine who defines the parent route, how cold and warm entry differ, and what a stack test actually establishes.

Published
October 12, 2026
Verified
October 11, 2026

The link opened the app. Why did the journey still break?

Someone receives a link to a profile, taps it, and sees the right page. The deep link appears to work. Then they press Back and leave the app altogether. There is no home screen or list to return to, although either would have made sense as the next step.

The test “did the link display the profile?” would pass. The person's journey did not.

This is easy to miss when testing a running app. Its existing navigation history can hide the problem. A cold launch removes that cover: if the profile is the only page created from the incoming link, there is no parent page for an in-app Back action to reveal. The mistake was not the pop operation. It was the route that was assembled before the user pressed Back.

A destination is not a journey

A deep link identifies a location inside an app. It might arrive as an Android App Link, an iOS Universal Link, a custom-scheme URI, a QR-code URL, or a route carried by a notification. Those are different ways of delivering an intent. None of them, by itself, specifies the complete in-app navigation history that should follow.

Take an illustrative address: https://app.example/profiles/42. Its path can identify profile 42. It cannot tell the app whether Back should reveal Home, a directory of people, or a team workspace. Nor can the path decide what to do when that profile has been deleted or requires authentication.

Four responsibilities are often collapsed into the word “deep linking”:

  1. The operating system recognizes an address and hands it to the app.
  2. The app accepts and parses that address into a meaningful destination.
  3. The product defines how someone reaches that destination and what should happen when they cannot.
  4. Navigation materializes the resulting pages and handles Back.

Domain association on Android or iOS is necessary for the first responsibility. A URI parser helps with the second. Neither can infer the third. A perfectly verified domain can still open a page that strands someone at the root of the app.

Flutter's deep-linking guide distinguishes cold and already running apps, and explains that Router can configure a new set of pages for an incoming route. That capability is not a product policy. The app still has to decide which pages should exist in that set. The Android App Links and iOS Universal Links setup guides cover another part of the chain: getting the URL into the app.

Where should Back go?

For a profile opened from outside the app, one product may choose Home → Profile. The first Back then reveals Home. Back at the final root can be left to the operating system. This is a defensible policy for that product, not a universal rule for every profile link.

A product page may belong under a catalog. An invitation may require sign-in before the person can accept it and enter a workspace. A message may belong under a conversation, which in turn belongs under a chat list. A parent page is not merely something inserted to prevent the app from closing. It should be a meaningful place from which the person can continue.

That leads to a question worth writing into requirements before choosing a router: after opening this class of external links, what should the first Back action reveal? The answer should also say what happens after authentication, and whether the answer changes when the app was already in use.

A warm link is particularly easy to mishandle. Imagine someone editing an unsaved request when a notification opens a profile. Replacing the current stack with Home → Profile may throw away the editing context. Pushing the profile over the current task may preserve it, but now Back returns to the editor rather than Home. Pausing to save or discard the draft is another policy. The URL cannot choose among these outcomes.

“Always replace the stack for a deep link” is convenient during a cold launch. It can be a surprisingly destructive default during a warm one.

Expressing the route as a stack plan

Once the expected journey has been defined, it can be represented as a stack plan: the pages that should exist together after the link is handled. For this example, the plan is Home → Profile(42). That is different from issuing a sequence of unrelated commands to open Home and then Profile. A sequence can expose an intermediate page or leave a partial route if the later step fails.

This design does not depend on a particular package. An application can construct the pages it gives to Flutter Router, use its existing router's equivalent facility, or choose a library with explicit stack plans. The essential contract is testable: incoming address, resolved destination, full stack, and the first Back result.

Ark Navigation implements one version of that contract. A URI codec turns /profiles/42 into a typed ProfileDestination. An optional stackPlanBuilder then gives the decoded destination its parent. The following is a route-definition fragment; HomeDestination, ProfileDestination, and ProfilePage are application types:

NavigationRouteDefinition<ProfileDestination, void>(
  id: const NavigationRouteId('profile'),
  pageBuilder: (context, destination, entry) =>
      ProfilePage(profileId: destination.id),
  uriCodec: CallbackNavigationUriCodec<ProfileDestination>(
    pattern: '/profiles/:id',
    encoder: (destination) => Uri(
      pathSegments: <String>['profiles', destination.id],
    ),
    decoder: (match) => ProfileDestination(match.path('id')),
  ),
  stackPlanBuilder: (destination) => <NavigationTarget<Object?>>[
    const NavigationTarget<Object?>(destination: HomeDestination()),
    NavigationTarget<Object?>(destination: destination),
  ],
)

The destination carries a stable identifier, not a loaded profile object or permission to read it. The application's data and access rules still decide whether the page can show that profile. The stack builder is responsible for route structure, not for deciding whether the profile exists.

There is an important limit to name explicitly. Ark Navigation does not discover parent pages from the URL. Without stackPlanBuilder, its default plan contains only the decoded destination. The package supplies a way to apply a product decision; it does not make that decision.

A local controller-level check against an ark_navigation 1.2.0 checkout covered three cases. With an explicit plan, restoring /profiles/42 on an empty controller produced HomeDestination → ProfileDestination(42). The first pop returned to /; a second pop did not remove the final root entry. Without a builder, the same URI produced only the profile. For an already populated controller, restoreUri replaced the previous stack with the declared plan. All three checks passed, as did the package's existing test of an explicit deep-link stack plan.

await navigation.restoreUri(Uri.parse('/profiles/42'));

final entries = navigation.value.scope(rootScope).entries;
expect(entries, hasLength(2));
expect(entries.first.destination, isA<HomeDestination>());
expect(entries.last.destination, isA<ProfileDestination>());

await navigation.pop();
expect(navigation.currentUri, Uri.parse('/'));

These checks establish the controller's stack and pop behavior. They do not establish that Android or iOS will deliver a real web link to this app, that a device's system Back will behave identically in every host configuration, or that unsaved work survives a warm link. The test did not run on a device or simulator. Calling this “cross-platform deep linking verified” would make a claim the evidence cannot support.

A valid link can point to an unavailable place

Another failure sits beyond navigation. The URI may parse correctly while profile 42 is private or gone. Quietly opening Home makes the problem look like a broken link and hides useful diagnostic information. Yet treating every invalid address and every unavailable profile as the same error also loses meaning.

An unknown or untrusted URI is an address-handling failure. A recognized profile URL whose data cannot be shown is an application outcome. The latter may need a sign-in path, an explanation that the profile was removed, or an access-denied state. If sign-in is required, the original destination must be retained and checked again afterwards; simply showing a login page is not a return journey.

Ark Navigation can validate accepted schemes and hosts for absolute links and allows an unknown-URI handler. Those are useful boundaries after Flutter hands the URI to the app. They do not configure native domain association, authorize the person, or load the profile. Keeping these responsibilities apart makes a failed link diagnosable instead of silently rerouting everyone to Home.

Testing the promise, not just the page

A practical review of one link class needs a short journey rather than a screenshot:

Situation Check
Cold launch The target opens; the first Back reveals the chosen parent
Warm launch The link does not discard an unfinished task contrary to product policy
Sign-in required The initial intent survives authentication, or a different path is explained
Target unavailable The person sees a meaningful outcome, not an unexplained Home page
Old link format A supported alias reaches the current destination

The stack can be unit-tested, as above. Platform delivery must be tested separately by opening a link from outside the app, both cold and warm, and using the system Back gesture or button. Flutter's Android guide explicitly distinguishes an adb launch that tests the app's setup from an end-to-end click that also exercises the hosted association files. On iOS, Associated Domains and the site-association file need their own verification (Android guide, iOS guide).

The useful design artifact is small: for each class of external links, record the destination, its expected parent, the first Back result, the warm-link rule, and the unavailable-target response. These are user-facing commitments. A router can enforce them, but it cannot infer them from a path string.

A link should do more than put the right page on screen. It should leave the person somewhere they can continue after that page.


ArkTelos Lab: Lab website · Ark Navigation on GitLab · ArkTelos

Channels: ArkTelos Lab EN · ArkTelos Lab RU · ArkTelos EN · ArkTelos RU

Result boundaries

  • Local tests checked the ark_navigation 1.2.0 controller contract: the stack plan, first and root pop, and stack replacement on warm entry. The full OS → Flutter → app → system Back flow on Android and iOS, authentication, and unavailable targets were not tested; no separate public experiment was created.

Telegram edition

Read in ArkTelos Lab

Read in ArkTelos Lab ↗

ARKTELOS CHANNELS

News and engineering material, without mixing languages.

The main channels cover ArkTelos development. ArkTelos Lab publishes architecture analysis, experiments, and reproducible research.