Skip to content

fix: Fix event detail closing on the first event detail opening - #248

Merged
LunarX merged 2 commits into
mainfrom
fix-event-opening-that-closes-instantly
Oct 16, 2026
Merged

LunarX merged 2 commits into
mainfrom
fix-event-opening-that-closes-instantly

Conversation

@LunarX

@LunarX LunarX commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Only emit Unavailable when the event is null. A missing calendar now keeps the Loading state instead of closing the screen.

Also fix the default value of the eventAndCalendar flow that was null and acted as a missing event.

I took this opportunity to use the new observeCalendar(event.calendarId) exposed by KMP 0.15.0.

This code will be slightly refactored soon when the state caching will live with the view model's lifecycle instead of GetEventDetailUiUseCase

Only emit Unavailable when the event is null. A missing calendar now keeps the Loading state instead of closing the screen.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@LunarX
LunarX requested review from sirambd and a balanced review from Copilot October 16, 2026 08:00
@LunarX LunarX self-assigned this Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused state-handling changes address premature closure with no identified blocking issues.

0 open findings

What changed in this PR

Fixes premature event-detail closure by distinguishing loading from a missing event.

Changes:

  • Keeps the screen loading until calendar data is available, using observeCalendar.
  • Reserves Unavailable for missing events and updates its documentation.
File Description
app/​src/​main/​java/​com/​infomaniak/​calendar/​ui/​screen/​eventDetail/​GetEventDetailUiUseCase.kt Introduces explicit loading, missing-event, and success states.
app/​src/​main/​java/​com/​infomaniak/​calendar/​ui/​screen/​eventDetail/​EventDetailUiState.kt Clarifies the Unavailable documentation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This can also be a normal situation which is why we don't set it as an error
@sonarqubecloud

Copy link
Copy Markdown

@LunarX
LunarX requested a review from sirambd October 16, 2026 08:37
@LunarX
LunarX enabled auto-merge October 16, 2026 08:37
@LunarX
LunarX merged commit 79b8e89 into main Oct 16, 2026
10 checks passed
@LunarX
LunarX deleted the fix-event-opening-that-closes-instantly branch October 16, 2026 11:04
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.

3 participants