Skip to content

Ignore opaque URIs in calendar deep links - #22

Merged
Tricked-dev merged 1 commit into
Tricked-dev:masterfrom
AKolenda:fix/calendar-deeplink-opaque-uri
Oct 21, 2026
Merged

Tricked-dev merged 1 commit into
Tricked-dev:masterfrom
AKolenda:fix/calendar-deeplink-opaque-uri

Conversation

@AKolenda

@AKolenda AKolenda commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

MainActivity is exported, so any installed app can start it with an explicit intent carrying any data URI. calendarDateFromUri calls Uri.getQueryParameter, which throws UnsupportedOperationException for opaque URIs such as solidtime:calendar?date=2026-08-11. The exception crashes the app.

Fix

calendarDateFromUri returns null for non-hierarchical URIs before reading any query parameters. solidtime://calendar?date=yyyy-MM-dd and solidtime://calendar/yyyy-MM-dd still resolve as before.

Tests

  • New Robolectric test CalendarDeepLinkUriTest. It checks that query and path calendar links still resolve, and that opaque URIs return null instead of throwing. The opaque-URI test fails with UnsupportedOperationException without the fix and passes with it.
  • On an emulator, adb shell am start -n dev.tricked.solidverdant.dev/dev.tricked.solidverdant.MainActivity -a android.intent.action.VIEW -d 'solidtime:calendar?date=2026-08-11' crashes the master build (UnsupportedOperationException: This isn't a hierarchical URI at CalendarDeepLink.kt:23). With this change the activity opens and nothing is written to the crash buffer.
  • spotlessCheck testDebugUnitTest lintDebug assembleDebug assembleDebugAndroidTest pass locally (990 unit tests, 0 failures).
  • CalendarDeepLinkE2eTest fails in CI before onCreate runs (last lifecycle transition = "PRE_ON_CREATE"). It fails the same way on unmodified master (f62e1eb) on a local emulator, so the failure was already there before this change.

MainActivity is exported, so an explicit intent can deliver any URI.
Uri.getQueryParameter throws on opaque URIs such as solidtime:calendar,
which crashed the activity. Return no calendar date for them instead.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T22:05:33.344296Z a8e5dee PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Tricked-dev
Tricked-dev merged commit 3fdd290 into Tricked-dev:master Oct 21, 2026
0 of 3 checks passed
@Tricked-dev

Copy link
Copy Markdown
Owner

thanks!

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.

2 participants