Skip to content

Typecast shared mount's storage_id to int as documented + some refactor to avoid similar bugs - #3588

Merged
LukasReschke merged 2 commits into
nextcloud:masterfrom
GreenArchon:issue_#3461
Feb 24, 2017
Merged

LukasReschke merged 2 commits into
nextcloud:masterfrom
GreenArchon:issue_#3461

Conversation

@GreenArchon

Copy link
Copy Markdown
Contributor

Fixes #3461

Basically both paths of apps/files_sharing/lib/SharedMount.php/getNumericStorageId() returned a string (oups), which caused (maybe among other things) an === comparison to fail in determining if the mounts should be updated in the database. In my ~30 users/desktop clients 11.0.1 instance with ~20 folders shared each, this caused a ~10s extra delay in every page load.

55a37c1 fixes the problem with casts were applicable, and cc511ac refactors "CacheEntry" object creation in Cache.php to use the already existing and wonderful cacheEntryFromData() function which does all casts properly to allow CacheEntry data to return results as documented, instead of semi-regularly casting some of that data.

Feel free to merge any of these commits separately if needed. Also, this should be backported to at least stable11 (as it is affected by #3461) and maybe older versions (haven't tested the bug on them).

Finally, note that I'm not that familiar with (or setup for) web development so the master checkout I did (before these changes) had some test failures (when running autotest) - I didn't know if it was the master failing or some system php packages missing and these changes don't cause more failures, but it should nevertheless be retested before merging.

…() all the time thus allowing proper casts to be done

Signed-off-by: Frédéric Fortier <[email protected]>
@mention-bot

Copy link
Copy Markdown

@GreenArchon, thanks for your PR! By analyzing the history of the files in this pull request, we identified @icewind1991, @rullzer and @schiessle to be potential reviewers.

@LukasReschke LukasReschke added the 3. to review Waiting for reviews label Feb 23, 2017
@LukasReschke
LukasReschke merged commit dd6d289 into nextcloud:master Feb 24, 2017
@GreenArchon

Copy link
Copy Markdown
Contributor Author

This (or at least cc511ac which is the bugfix) should also be backported to stable11, as it is affected by #3461

I think @karlitschek is the one to ask?

@LukasReschke

Copy link
Copy Markdown
Member

@icewind1991 Your thoughts on that? I'd tend to agree on that. Any objections?

@karlitschek

Copy link
Copy Markdown
Member

@icewind1991 your call if this should be backpoted or not.

@icewind1991

Copy link
Copy Markdown
Member

Backport is fine

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

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oc_mounts is updated all the time with the same information

5 participants