Skip to content

Conversation

DominicGBauer
Copy link
Contributor

@DominicGBauer DominicGBauer commented Mar 31, 2024

Description

Improve attachment queue so that multiple uploads, downloads and deletes don't run simultaneously. This is related to this support query in discord https://discord.com/channels/1138230179878154300/1220388800455250082

Work Done

  • Replaced watchDownloads, watchUploads and watchDeletes into a single watcher watchAttachments so that duplicate upload, download or delete function calls do not occur when table is updated.
  • Replaced runDownloads, runUploads and runDeletes into a single function runSync so that duplicate upload, download or delete function calls do not occur when table is updated.
  • Updated dependencies
  • Updated docs

How to test

  • Delete the demo app from the device you are using. Make sure you have set a bucket in config.
  • Install the demo app and log in
  • You should see a watcher run and begin downloading images. These should happen one at a time and not be duplicated.
  • Now create a new todo and attach a photo.
  • The upload should only occur once.

Videos

Downloading

screen-recording-2024-04-02-at-130417_Aa9oZDNz.mp4

Uploading

Screen.Recording.2024-04-02.at.13.15.13.mov

Deleting

screen-recording-2024-04-02-at-130920_4WxKweoD.mp4

@DominicGBauer DominicGBauer changed the title chore: improve attachment queue fix: attachment queue duplicating requests Apr 2, 2024
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

LGTM

@DominicGBauer DominicGBauer merged commit 242636f into master Apr 3, 2024
@rkistner rkistner deleted the bug/improve-attachments-queue branch September 6, 2024 08:01
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