Skip to content

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

Merged
BurningAXE merged 1 commit intomainfrom
MS-1379-Crash-when-attempting-to-save-big-metadata
Mar 17, 2026
Merged

[MS-1379] Don't crash on huge metadata#1608
BurningAXE merged 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.

@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
Copy link
Contributor

@alexandr-simprints alexandr-simprints left a comment

Choose a reason for hiding this comment

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

Don't see any problems with it at the first glance. What Intent Launcher version supports sending large amount of data to SID?

@BurningAXE
Copy link
Contributor Author

BurningAXE commented Mar 12, 2026

What Intent Launcher version supports sending large amount of data to SID?

My local one :D But if it's going to be useful for more than a one-off, I can push the changes.

@BurningAXE BurningAXE requested review from a team, TristramN, alex-vt, luhmirin-s, meladRaouf and ybourgery and removed request for a team March 12, 2026 17:12
…d multiple copies of arguments in associated VMs
@BurningAXE BurningAXE force-pushed the MS-1379-Crash-when-attempting-to-save-big-metadata branch from 3c15faf to 98a2337 Compare March 13, 2026 11:37
@sonarqubecloud
Copy link

@Inject
lateinit var lastCallingPackageStore: LastCallingPackageStore

private val intentAction get() = requireActivity().intent.action.orEmpty()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-pick: this syntax is a bit confusing and hides the type, I would prefer it a bit more explicit:

private val intentAction: String
   get() = requireActivity().intent.action.orEmpty()

It could also be lazy, as there calling intent shouldn't change.

@BurningAXE BurningAXE merged commit 6c5841d into main Mar 17, 2026
14 checks passed
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.

4 participants