-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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(mobile): 14983 Images upload to shared album with common name #15127
base: main
Are you sure you want to change the base?
fix(mobile): 14983 Images upload to shared album with common name #15127
Conversation
…lbum if a shared album conflicts with a local users album.
…ses-upload-to-wrong-album
Hello, can you write a few words in the PR's description on how you tested this? |
…oved incorrect isShared comment. Using `getAll(shared: true)` gets all shared albums the user can access (regardless of owner, despite the previous comment). Using `getAll(shared: null)` gets all albums (incuding shared = true and shared = false). I presume the intent here was to get albums that were shared (and not mine), and not shared (ie: mine), but the logic is way off. It also just then combines them - so makes more sense to just get them in a single call.
Have updated now that I've had a chance to test. My initial assumption that "shared" means "not mine" was wrong - but I'm not the first person to make this mistake D: Would appreciate some feedback on my other notes above :) |
e9da4ca
to
3a92fa8
Compare
…ses-upload-to-wrong-album
Thank you. I will take a look at this in the coming days |
This PR should address #14983.
The issue is caused because the client just asks for the first album with the matching name - which can result in the shared folder being returned.
The methods in question should never be uploading to an album owned by someone else, so setting shared to false in these cases should work (assuming I understand "shared" correctly - ie: that the item is shared with me).Above assumption was wrong - have used ownerId instead.
Testing performed:
Other notes:
Messing around with creating/deleting folders and adding to them can cause pretty weird issues because the "album exists" check is done locally; so if the albums aren't synced it will result in creation of a new album with that same name. This was apparent when creating new albums remotely and then immediately doing a sync for an album with the same name on the client - a new album would be created causing a duplicate (yuk!)
In general, the sync system seems to be a little unreliable across these types of cases... Not sure the best long-term solution - a unified storage engine that handles remote and local through a single interface (think Firebase RTDB) would probably be the cleanest... I tried forcing an remote album refresh before adding assets, but this was non-trivial and expensive.
Related to my investigation of the above, the
refreshRemoteAlbums()
call has some strange logic that "works" but isn't really what was intended when written.Have simplified this code to do what it should do (without the confusing bits) - would appreciate feedback on this commit in particular: 979ce9