EditSubscriptionScreen wrongly goes into edited state#664
Conversation
sunkup
left a comment
There was a problem hiding this comment.
I would love to say that fixes it. But it still happens :/ And I totally get that this is hard to debug. I feel like the state of the whole code base is not good, because we mix so many approaches at the moment.
EditSubscriptionScreen wrongly goes into edited state
|
Okay, now it should be good. The thing was that all
|
sunkup
left a comment
There was a problem hiding this comment.
Very nice! It's always pleasing to see when code can be deleted. We should also update the kdoc though.
At some point we should use flows instead of LaunchedEffect or the view model init method, but for now let's get this working as is. 👍
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the EditSubscriptionScreen was incorrectly detecting changes as dirty due to a typo in property comparison. The fix involves replacing reactive flow collection with direct data fetching and consolidating the subscription state initialization logic.
- Replace flow-based subscription loading with direct database query to avoid state synchronization issues
- Consolidate subscription and credential initialization into a single
update()method - Fix property comparison for dirty state detection by using computed property instead of stored variable
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| EditSubscriptionScreen.kt | Remove flow collection and use direct property access for subscription data |
| SubscriptionSettingsUseCase.kt | Add update() method to initialize UI state from subscription and credential data |
| EditSubscriptionModel.kt | Replace flow-based loading with direct query and fix dirty state detection logic |
| SubscriptionsDao.kt | Add non-flow method to get subscription with credentials by ID |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
…edited-state # Conflicts: # app/src/main/java/at/bitfire/icsdroid/model/EditSubscriptionModel.kt
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
|
Ready to merge when you want to 👍 |
Purpose
The edit subscription screen is misdetecting changes as dirty.
Short description
That was a tough one to spot.
Checklist