Skip to content

refactor(auth): remove invite-code onboarding - #9113

Merged
NotThatKindOfDrLiz merged 17 commits into
mainfrom
dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb
Sep 15, 2026
Merged

NotThatKindOfDrLiz merged 17 commits into
mainfrom
dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb

Conversation

@dcadenas

@dcadenas dcadenas commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Description

Invite codes are no longer part of onboarding, but the app still carried a remotely controlled invite gate and its supporting code. That leftover code could re-enable obsolete onboarding or surface invite language when server configuration changed, so this removes it end to end. Collaborator invitations and email-verification PINs are separate features and keep working.

What changed

  • Removed the invite gate, invite-protected account creation, invite status and availability code, developer override, settings entry, routes, deep links, analytics calls, localized copy, documentation, tests, and the invite_api_client package.
  • Account creation, sign-in, and recovery no longer request, validate, consume, or store an invite code.
  • Retired pending-verification invite data is deleted during cold-start restore and whenever that record is written or cleared. task(auth): remove retired invite-code storage cleanup #9116 tracks removing this compatibility cleanup after the supported upgrade window.
  • Preserved EmailVerificationCubit across environment changes by keying its provider on its remaining live dependencies.
  • Added the former invite-dependent video creation flow to Linux service CI. The test uses the existing platform-channel harness because headless Linux has no Secret Service/keyring session, while still exercising real app startup and navigation.
  • Rebased onto current main and reconciled the current Codemagic analytics validation.

Legacy /invite/* links

  • Android no longer claims the /invite app-link prefix, so legacy links fall through to the web page.
  • iOS still opens the app without navigating because the served web AASA continues to claim /invite/* during the coordinated retirement. The mobile coverage test records that hold explicitly. Until the web claim is withdrawn, legacy invite values remain redacted from diagnostics.

Related issue

Closes #8537
Refs #9116
Refs divinevideo/divine-context#100

Out of scope

  • Collaborator invitations, email-verification PINs, and the settings share sheet are unchanged.
  • Web invite surfaces and supporting services remain part of the coordinated cross-repository retirement.
  • The vendored analytics contract retains externally owned generic enum values named invite.

Verification

  • Pinned Flutter 3.47.2 / Dart 3.13.2.
  • dart analyze over lib, test, integration_test, and tools: no issues.
  • Takeover pre-push gate: 1,394 affected tests passed.
  • Focused service-suite coverage and platform-channel helper tests: 18 passed.
  • Hosted Mobile CI: analysis, formatting, generated files, goldens, and all four test shards passed.
  • Hosted Linux service integration: all 14 included suites passed, including video_creation_flow_test.dart.
  • Web preview build, analytics package build, semantic title, mergeability, configuration, VGV, and CLA checks passed.

Risks

  • The iOS /invite/* interim behavior remains until the web-owned AASA claim is withdrawn.
  • This is a broad deletion. The compatibility cleanup intentionally remains for one supported upgrade window and has a tracked removal issue.

Type of change

  • 🧹 Code refactor

@dcadenas
dcadenas requested a review from a team as a code owner September 13, 2026 00:15
@dcadenas
dcadenas requested review from NotThatKindOfDrLiz and mbradley and removed request for a team September 13, 2026 00:15
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@NotThatKindOfDrLiz

Copy link
Copy Markdown
Member

@dcadenas I pushed four takeover commits to address the review findings and waited for the replacement CI run to finish.

Fixed:

  • Restored /invite/<code> redaction while iOS still claims legacy invite links, with a regression test.
  • Moved retired invite-key cleanup onto the cold-start load() path as a best-effort migration, covered load/save/clear and deletion-failure behavior, and linked its removal TODO to task(auth): remove retired invite-code storage cleanup #9116.
  • Removed the now-unused setUserProperty analytics API and the tests/mocks that existed only for it.
  • Repaired the analytics-observability Markdown list and wrapped the two long test lines.

Escalated: none.

Declined: none.

Verification:

  • Pre-push changed-file analysis: no issues; 1,390 affected tests passed.
  • Focused takeover regression suite: 95 app tests passed.
  • Analytics package: 81 tests passed; 76.94% coverage against the 73% floor.
  • Hosted CI on 0852b0dce: all checks green, including all four test shards, generated files, goldens, Android build, web preview, and service integration.

I also updated the PR description to reflect the startup migration and #9116. @mbradley remains requested; I’m approving this revision. Please review the takeover commits and merge when you’re ready.

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the final takeover head after all local and hosted checks passed. The invite-removal scope is complete, the legacy logging invariant is preserved, and the compatibility cleanup has an explicit removal tracker.

@NotThatKindOfDrLiz

Copy link
Copy Markdown
Member

Overlap heads-up: this broad auth cleanup intersects #9112 in Android configuration and localization output, and draft #8540 across the localization/generated-localization set. Please coordinate merge order; after either competing PR lands, rebase onto fresh origin/main, regenerate localization output, and verify that invite removal, authenticated key export, and list UI copy all remain intact.

@mbradley mbradley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcadenas I pushed one commit. It closes a gap the invite removal left in logging.

The PR keeps redactUriStringForLogs and rewrites its doc to say it covers legacy invite paths. That reasoning holds: iOS still claims /invite/* through the served AASA, so those links still open the app. But parseDeepLink no longer has an /invite branch, so a legacy link falls through to the unknown-path log, and that log printed uri.path raw. Before this PR the invite branch logged Parsed invite deep link (code [REDACTED]). After it, the code reaches diagnostics.

f63d82996 routes that log site through the helper, the way the other four sites in mobile/lib/services/deep_link_service.dart already are, and adds a test that goes through parseDeepLink.

The existing regression test calls redactUriStringForLogs directly and never enters parseDeepLink, which is why it stayed green through this change. The new test fails without the fix:

Expected: not contains 'ABCD-EFGH-SECRET'
  Actual: 'Unknown deep link path: /invite/ABCD-EFGH-SECRET'

The message now reads Unknown deep link and carries the redacted URI, since the value is no longer only a path.

Validation

dart analyze and dart format clean on both files. 84 tests pass in mobile/test/services/deep_link_service_test.dart.

Hosted CI has not run on this head. GitHub created no Actions check suite for f63d82996, and the branch has conflicted with main since #9093 landed at 05:43Z today. The last full green run was on 0852b0dce, before that commit. Other pull requests built normally in the same window, so this is the branch state and not the runners. A rebase should restore the run.

Left to you

Both items come from the branch sitting behind main. @NotThatKindOfDrLiz already called for a rebase in her merge-order note; these are the specifics.

codemagic.yaml conflicts. #9093 added two lines on main next to the comment block this PR deletes. The resolution is to keep main's check_ios_analytics_product.sh lines and drop the eight-line GH_ACTIONS_PR_PREVIEW comment. I am not on @divinevideo/platform, so I left the file alone.

After the merge, two ratchet baselines need regenerating. They are accurate for this branch and stale against main:

service_god_file_sizes.txt  lib/services/video_event_service.dart          main 6499  branch 6411
async_safety_counts.txt     test/blocs/fullscreen_feed/..._bloc_test.dart  main 4     branch 5
async_safety_counts.txt     test/unit/subscription_manager_tdd_test.dart   absent on main, present here

Main deleted subscription_manager_tdd_test.dart and drove the other counts down after this branch was cut. On the merged tree the baseline reads as a raise:

FAIL [async_safety_ceiling]: baseline ADDED a key or RAISED a ceiling vs origin/main (may only shrink):
  +added discarded_futures|test/unit/subscription_manager_tdd_test.dart	2
  ^raised discarded_futures|test/blocs/fullscreen_feed/fullscreen_feed_bloc_test.dart	4 -> 5

Regenerate under the SDK pin, per the note at mobile/scripts/check_async_safety_ceiling.sh:31-37.

One question

mobile/integration_test/e2e/service_suite_exclusions.txt:8 excludes video_creation_flow_test.dart because it "requires the invite service", and this PR removes that service from local_stack/docker-compose.yml. Nothing else under integration_test/e2e/ mentions invites, so the dependency looks environmental. Does that suite come off the exclusion list now, or does it still need something the invite container was providing?

@NotThatKindOfDrLiz the head moved past your approval.

Approving.

@NotThatKindOfDrLiz
NotThatKindOfDrLiz force-pushed the dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb branch from f63d829 to 140bd8c Compare September 14, 2026 15:39
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@NotThatKindOfDrLiz
NotThatKindOfDrLiz requested review from a team and realmeylisdev and removed request for a team September 14, 2026 16:43
@NotThatKindOfDrLiz

Copy link
Copy Markdown
Member

@dcadenas Takeover complete on current head 879004ce5.

Fixed:

  • Rebased the branch onto current main and resolved the obsolete Codemagic preview conflict while retaining the current iOS analytics validation.
  • Regenerated/reconciled the invite-removal ratchets against current main.
  • Removed video_creation_flow_test.dart from the service-suite exclusion debt and added it to the app-level Linux service suites.
  • Diagnosed the first hosted service failure: headless Linux has no Secret Service/keyring session, so database encryption bootstrap rendered the fail-closed screen before onboarding. The suite now installs the existing test platform-channel harness before launching the real app.
  • Updated the PR description to match the final scope and verification.

Declined: none.

Escalated/unresolved: none.

Verification is green on the current head: the pre-push gate passed 1,392 affected tests, and every hosted check passed, including all four Mobile CI shards, generated files, analysis, web preview, analytics build, and all 14 Linux service integration suites.

Please review the takeover commits and keep the merge decision with you.

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current takeover head 879004c after all local and hosted checks passed. The branch is rebased, the retired invite flow is covered by Linux service CI, and the headless secure-storage dependency is isolated to the test harness.

@NotThatKindOfDrLiz
NotThatKindOfDrLiz force-pushed the dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb branch from 879004c to 3c36c8e Compare September 14, 2026 17:23
@github-actions

This comment has been minimized.

@NotThatKindOfDrLiz

Copy link
Copy Markdown
Member

Final takeover update: main moved after the first green handoff, so I rebased once more and resolved the new service-size ratchet conflict by keeping main's stricter 6389-line ceiling.

Current head: 3c36c8e49.

  • origin/main is an ancestor of the current head.
  • The worktree is clean.
  • The pre-push gate passed all 1,392 affected tests after the rebase.
  • Every hosted check passed again, including all four Mobile CI shards, generated files, analysis, web preview, analytics build, and all 14 Linux service integration suites.

No items remain escalated or unresolved. @dcadenas, please review the takeover commits; the merge decision remains yours. @realmeylisdev is requested through the normal reviewer-team rotation.

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved current takeover head 3c36c8e after the final rebase. origin/main is an ancestor, the worktree is clean, the 1,392-test pre-push gate passed, and every hosted check—including all 14 Linux service suites—is green.

@NotThatKindOfDrLiz
NotThatKindOfDrLiz force-pushed the dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb branch from 3c36c8e to 7d8a6fa Compare September 14, 2026 17:45
@github-actions

This comment has been minimized.

@NotThatKindOfDrLiz

Copy link
Copy Markdown
Member

Superseding the earlier handoff after two additional main updates landed during CI:

  • Final head: 7d8a6fad5.
  • Current base: 057700c71; it is an ancestor of the PR head.
  • GitHub reports MERGEABLE / CLEAN.
  • Worktree is clean.
  • Final pre-push gate: 1,394 affected tests passed.
  • Every hosted check is green, including all four Mobile CI shards, generated files, analysis, web preview, analytics build, and all 14 Linux service integration suites.
  • Fixed: all review and rebase items.
  • Declined: none.
  • Escalated/unresolved: none.

@dcadenas, the takeover is complete; please review the pushed commits and make the merge decision. @realmeylisdev remains requested through the normal reviewer-team rotation.

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved final takeover head 7d8a6fa. GitHub reports MERGEABLE/CLEAN, current main is an ancestor, the worktree is clean, all 1,394 affected pre-push tests passed, and every hosted check—including all 14 Linux service suites—is green.

dcadenas and others added 17 commits September 14, 2026 20:00
Removing the /invite branch from parseDeepLink sends those URIs to the
unknown-path log, which prints uri.path raw. Before this PR the branch
logged "Parsed invite deep link (code [REDACTED])", so the code never
reached diagnostics. iOS still claims /invite/* through the served AASA, so
a legacy link opens the app and writes the code out.

The redaction helper and its doc were deliberately kept for exactly this
case, and the same file already routes four other log sites through it. This
one was missed. Its test covers the helper rather than the path, which is why
it stayed green: reverting this fix leaves that test passing.

Verified the leak and the fix at the path level:

  Expected: not contains 'ABCD-EFGH-SECRET'
    Actual: 'Unknown deep link path: /invite/ABCD-EFGH-SECRET'

The message now says "Unknown deep link" and carries the redacted URI, since
the value is no longer only a path.

Claude-Session: https://claude.ai/code/session_01FscwT5Nw4noChSRnGbbybo
@NotThatKindOfDrLiz
NotThatKindOfDrLiz force-pushed the dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb branch from 7d8a6fa to dd0a7d4 Compare September 15, 2026 01:02
@github-actions

Copy link
Copy Markdown

Mobile PR Preview

Preview refreshed for dd0a7d4

Last refresh: dd0a7d4 at 2026-09-15 01:07:10 UTC (preview run)

Property Value
Preview URL https://6d3b71bb.openvine-app.pages.dev
Pages project openvine-app
Preview branch pr-9113
PR branch dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb
Commit dd0a7d4

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved the final rebased head dd0a7d4. I resolved the current-main conflict, preserved the newer detached async cleanup behavior, restored the router async import required by current main, and reconciled the async-safety ratchet. All hosted checks, including the 14-suite service integration job, are green.

@NotThatKindOfDrLiz

Copy link
Copy Markdown
Member

Final takeover handoff for dd0a7d4bde: I rebased onto current main, resolved the inbox/async-ratchet conflict, fixed the router compile regression exposed by the rebase, and pushed the verified result. The full pre-push gate passed (1,399 affected tests), every hosted check is green, and GitHub reports MERGEABLE/CLEAN. @dcadenas please take a final look; @realmeylisdev remains the requested normal reviewer. This supersedes the earlier handoff comments.

@NotThatKindOfDrLiz
NotThatKindOfDrLiz added this pull request to the merge queue Sep 15, 2026
Merged via the queue into main with commit db8f9ee Sep 15, 2026
22 checks passed
@NotThatKindOfDrLiz
NotThatKindOfDrLiz deleted the dw-author-divinemobile-is8537-9b2035fc964503049a2b4e281650d5eae7a517fb branch September 15, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(auth): remove invite-code onboarding

3 participants