Skip to content

Conversation

@abonander
Copy link
Contributor

@abonander abonander commented Jan 13, 2026

Summary

  • Don't set readonly by default to avoid conflicts with existing user settings.
    • It can still be set/overridden using Client::with_option() or Query::with_option().

closes #343
fixes #373
closes #361 (superceded PR)

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
    • Examples
    • Integration test (waiting on bikeshedding)
  • A human-readable description of the changes was provided so that we can include it in CHANGELOG later
  • Questions:
    • I chose the method name with_read_only to match the ReadOnly enum even though the option name is readonly. If it was with_readonly() then for consistency the enum should be named Readonly but that doesn't look right. Does this make sense?
    • Is with_read_only / the ReadOnly enum overkill? I imagine most of the time the reason to set readonly is to override what we set by default, which I'm deleting anyway as it's causing a regression (v0.14.1 is incompatible with settings profiles setting readonly=2 #373). Otherwise it's always possible to set through with_option/set_option.
    • Does it make sense that with_read_only(false) unsets the option rather than sending readonly="0"? Practically speaking, there isn't really a use for sending readonly="0" because it's either redundant (the user/session already has read-write permissions) or not allowed (the user/session is already read-only).

@abonander abonander requested review from serprex and slvrtrn January 13, 2026 00:29
@abonander
Copy link
Contributor Author

cc @svix-jbrown

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query.rs 25.00% 0 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

serprex
serprex previously approved these changes Jan 13, 2026
@loyd
Copy link
Collaborator

loyd commented Jan 13, 2026

Is with_read_only / the ReadOnly enum overkill? I imagine most of the time the reason to set readonly is to override what we set by default, which I'm deleting anyway as it's causing a regression (#373). Otherwise it's always possible to set through with_option/set_option.

Probably it's overkill, creates other questions about the API around this method and requires more code to satisfy code coverage. While there are cases when someone wants to lower their rights, it's uncommon.

@abonander abonander added this to the 0.14.2 milestone Jan 13, 2026
@abonander abonander changed the title feat: add readonly setter, don't set by default refactor: don't set readonly by default Jan 13, 2026
@abonander
Copy link
Contributor Author

Deleted the with_read_only setters and just kept the change to the default.

@abonander abonander requested review from loyd and serprex January 13, 2026 23:25
@abonander
Copy link
Contributor Author

I want to say we should ignore the codecov failure this time. There's no way deleting code made the diff coverage go down.

@abonander abonander merged commit f1d97fb into main Jan 13, 2026
7 of 8 checks passed
@abonander abonander deleted the ab/readonly branch January 13, 2026 23:33
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.

v0.14.1 is incompatible with settings profiles setting readonly=2 Add Query::readonly setter

3 participants