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: regression with updating read-only config #44039

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

Dreamsorcerer
Copy link
Contributor

Revert some changes for #29901.

Old behaviour before those changes (and again, after this PR):
Nextcloud calls set('theme', '') etc. Because the existing config has the same values, it does not attempt to write anything to the config file. If the config file would get changed, then it gives an error if the read-only option is set.

Regression behaviour:
The same call is made and immediately errors despite the fact that the config file will not be changed.

The set()/delete() methods are clearly written in a way that they skip writing changes if the value is already the same, but the previous changes make a check before those checks, thus erroring when there are no changes to write. The same PR also adds this check to writeData(), which is called by both of these methods, making them redundant.

@Dreamsorcerer Dreamsorcerer mentioned this pull request Mar 6, 2024
8 tasks
@solracsf solracsf requested a review from mejo- March 7, 2024 23:15
@solracsf solracsf added the 3. to review Waiting for reviews label Mar 7, 2024
Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

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

Looks sensible to me, given that checkReadOnly() is called again in writeData() anyway.

@Dreamsorcerer
Copy link
Contributor Author

Updated the commit message, I don't think the other failures are related to my change (maybe my fork was old though, so I've rebased).

@Dreamsorcerer Dreamsorcerer changed the title Fix regression with updating read-only config fix: regression with updating read-only config Mar 12, 2024
@Dreamsorcerer
Copy link
Contributor Author

Any chance of getting this in for 29?

@come-nc come-nc added this to the Nextcloud 30 milestone Apr 2, 2024
@come-nc
Copy link
Contributor

come-nc commented Apr 2, 2024

/backport to stable29

@come-nc
Copy link
Contributor

come-nc commented Apr 2, 2024

/backport to stable28

@come-nc
Copy link
Contributor

come-nc commented Apr 2, 2024

/backport to stable27

@Dreamsorcerer
Copy link
Contributor Author

Looks like something got stuck on the CI, so this still hasn't merged yet..

@mejo- mejo- force-pushed the patch-2 branch 2 times, most recently from 2ed85ea to e746156 Compare April 18, 2024 08:41
@mejo-
Copy link
Member

mejo- commented Apr 18, 2024

I guess the cypress tests fail due to the parent branch living in a forked repository.

@Dreamsorcerer
Copy link
Contributor Author

I guess the cypress tests fail due to the parent branch living in a forked repository.

Looks like my previous PRs were merged with these failing, so I'm guessing that making them required checks is probably not the right option while it doesn't work in forks.

@Altahrim Altahrim merged commit 4af9bef into nextcloud:master Apr 18, 2024
149 of 156 checks passed
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.

5 participants