refactor(room): Split two-arg setActiveSince() into single-arg setters#17811
Open
miaulalala wants to merge 4 commits intomainfrom
Open
refactor(room): Split two-arg setActiveSince() into single-arg setters#17811miaulalala wants to merge 4 commits intomainfrom
miaulalala wants to merge 4 commits intomainfrom
Conversation
Part of the incremental migration of `Room` to extend `OCP\AppFramework\Db\Entity` (Phase 1d). `Room::setActiveSince(\DateTime $since, int $callFlag)` combined two concerns — conditionally setting the active-since timestamp and bitwise-ORing the call flag — in a single two-argument method. Entity's magic `__call()` requires standard single-argument setters. - Replace with `setActiveSince(?\DateTime $activeSince)` and `setCallFlag(int $callFlag)` - Move the conditional/bitwise logic into `RoomService::setActiveSince()`, where it already lived conceptually AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
…h call Verifies that the bitwise OR previously in Room::setActiveSince() is preserved after moving it to the service layer. AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
Contributor
Author
|
@copilot resolve the conflicts |
Co-authored-by: miaulalala <7427347+miaulalala@users.noreply.github.com>
Resolved in d67c7a2. Merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the incremental migration of
Roomto extendOCP\AppFramework\Db\Entity(Phase 1d).Room::setActiveSince(\DateTime $since, int $callFlag)combined two concerns — conditionally setting the active-since timestamp and bitwise-ORing the call flag — in a single two-argument method. Entity's magic__call()requires standard single-argument setters.setActiveSince(?\DateTime $activeSince)andsetCallFlag(int $callFlag)RoomService::setActiveSince(), where it already lived conceptuallyWhy the split is safe
cc @nickvergessen
This differs from the related
getLobbyState()/getLobbyTimer()refactor in an important way: there is no interdependency problem here.The original setter's logic was already redundant:
if (!$this->activeSince)guard in Room was defensive duplication —RoomServicealready ensuressetActiveSince()is only called on the fresh-call path (whengetActiveSince() === null), never on the upgrade-flags path.$this->callFlag |= $callFlagbitwise merge was also redundant —RoomService::setActiveSince()already computes$callFlag |= $oldCallFlagbefore calling Room's setter.Events fire after both setters: On the fresh-call path,
CallStartedEventis dispatched after bothroom->setActiveSince()androom->setCallFlag(). No event handler observes state between the two calls. Same for the upgrade-flags path.Getters were already pure:
getActiveSince()andgetCallFlag()never had side effects. The lobby refactor exposed a problem with lazy side effects in getters; that pattern does not exist here.AI-Assisted-By: Claude Sonnet 4.6 noreply@anthropic.com
🛠️ API Checklist
🏁 Checklist
docs/has been updated or is not required