Skip to content

Fix race condition in photos picker - #367

Merged
lukasdotcom merged 2 commits into
nextcloud:mainfrom
MarcelRobitaille:task/photos_race_condition
Sep 24, 2026
Merged

lukasdotcom merged 2 commits into
nextcloud:mainfrom
MarcelRobitaille:task/photos_race_condition

Conversation

@MarcelRobitaille

Copy link
Copy Markdown
Contributor

There's a race condition:

  • onImportPhotos request started
  • pollPickerSession request started
  • onImportPhotos request completes. startingPhotoImport set to false. pickerSessionId set to false
  • pollPickerSession request completes. startingPhotoImport is false, so it triggers onImportPhotos again. sessionId is null so it fails.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

Signed-off-by: Marcel Robitaille <mail@marcelrobitaille.me>

@lukasdotcom lukasdotcom 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.

Hi @MarcelRobitaille 👋. Thanks for the pr. I would also make sure the session id is the same as before the request not just defined.

@MarcelRobitaille

MarcelRobitaille commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Good idea. Implemented

@lukasdotcom

Copy link
Copy Markdown
Member

Good idea. Implemented

I don't seem to see any changes. Did you forget to push your changes?

@MarcelRobitaille

Copy link
Copy Markdown
Contributor Author

Sorry pushed to the wrong branch

Co-authored-by: Marcel Robitaille <mail@marcelrobitaille.me>
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
@lukasdotcom
lukasdotcom force-pushed the task/photos_race_condition branch from 0c00ed3 to add4929 Compare September 24, 2026 08:17
@lukasdotcom
lukasdotcom self-requested a review September 24, 2026 08:20

@lukasdotcom lukasdotcom 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.

You had a few typos, but I fixed them for you. Thanks for the pr.

@lukasdotcom
lukasdotcom merged commit dad71ea into nextcloud:main Sep 24, 2026
22 checks passed
@MarcelRobitaille
MarcelRobitaille deleted the task/photos_race_condition branch September 24, 2026 19:40
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants