Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multimedia options opening more than once #17455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

criticalAY
Copy link
Contributor

Purpose / Description

Root Cause of the issue was:

  • Persistent Flow Subscription: Each time handleMultimediaActions is called, a new subscription to the multimediaAction flow is created, leading to multiple active observers.
  • Race Condition: When an action is emitted, all active subscriptions are notified, causing the action to be handled multiple times.

Fixes

Approach

Keep track of the job

How Has This Been Tested?

Tested on Google emulator API35

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

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

Ok, this seems to fix the linked issue at least

Note: there's a bug if MultimediaImageFragments's activity gets killed during the user choosing an image for example. If this happens the user will be stuck in the choosing screen.

How to reproduce: enable "Don't keep activities" -> NoteEditor -> Attach Icon -> go and select "Open gallery" -> try to select an image -> stuck in the image chooser screen

It would be nice to fix this issue in this PR(it's the same opening multiple times but for a different reason) but I would also accept merging this and creating an issue with the bug above.

@lukstbit lukstbit added Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Multimedia Option Open Twice When Bottom Sheet is Opened Twice
2 participants