Skip to content

[MS-1379] Don't crash on huge metadata#1608

Open
BurningAXE wants to merge 1 commit intomainfrom
MS-1379-Crash-when-attempting-to-save-big-metadata
Open

[MS-1379] Don't crash on huge metadata#1608
BurningAXE wants to merge 1 commit intomainfrom
MS-1379-Crash-when-attempting-to-save-big-metadata

Conversation

@BurningAXE
Copy link
Contributor

@BurningAXE BurningAXE commented Mar 6, 2026

JIRA ticket
Will be released in: 2026.2.0

Root cause analysis (for bugfixes only)

First known affected version: at least since the last navigation refactoring

  • Calling app can send in the metadata whatever extra info they want
  • When this data is ~ 200K (!) we accept and pass it to OrchestratorFragment as argument
  • OrchestratorFragment has 3 lazily initialized VM (loginCheck, clientApi, orchestrator)
  • When app is minimized, each VM saves the fragment args in addition to a few more copies from the fragment and Nav controller
  • This leads to the saved state Bundle exceeding the max size of 1MB
  • KABOOM

Notable changes

  • Instead of doing risky changes and jumping through hoops, we simply don't pass intent data as fragment args but read it directly through the activity
  • This avoids all the data copies on saving state while having no down sides

Testing guidance

  • Send an Intent with at least 200K metadata (I've made a modification in Intent Launcher that does this as otherwise copy-paste buffer cannot handle so much data)
  • Wait for SID to open and process the request (e.g. reach the Consent screen)
  • Minimize it
  • Bring it back - should still be on the same screen which means it didn't crash

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a crash caused by oversized navigation arguments/saved-state bundles when caller apps send very large metadata in the launch Intent, by no longer passing Intent data through NavArgs and instead reading it directly from the hosting Activity.

Changes:

  • Removed requestAction / requestParams navigation arguments from the orchestration graph.
  • Stopped initializing the orchestration graph with fragment args in OrchestratorActivity.
  • Updated OrchestratorFragment to read Intent.action and Intent.extras from the activity at runtime (and populate caller-package info there).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
feature/orchestrator/src/main/res/navigation/graph_orchestration.xml Removes orchestration fragment args so large metadata isn’t duplicated into fragment arguments.
feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/OrchestratorFragment.kt Reads action/extras from Activity.intent and sets caller package info without using NavArgs.
feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/OrchestratorActivity.kt Initializes nav graph without passing Intent data as fragment args.

You can also share your feedback on Copilot code review. Take the survey.

…d multiple copies of arguments in associated VMs
@BurningAXE BurningAXE force-pushed the MS-1379-Crash-when-attempting-to-save-big-metadata branch from edd362c to 3c15faf Compare March 6, 2026 11:26
@BurningAXE BurningAXE marked this pull request as ready for review March 6, 2026 11:29
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants