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: wrong attendance status for imip events #10024

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

kesselb
Copy link
Contributor

@kesselb kesselb commented Aug 20, 2024

Problem

The attendence status for an imip event might be wrong.

Before

Screencast.from.2024-08-20.13-53-29.webm

After

Screencast.from.2024-08-20.13-52-35.webm

Commit a1ecb2e

One may have imported an event, but the attendance status is not properly fetched when rendering the email.
The reason is a timing / state problem.

  • Loading the user principal and collections is initialized in

    mail/src/App.vue

    Lines 49 to 50 in 6fc45eb

    await this.$store.dispatch('fetchCurrentUserPrincipal')
    await this.$store.dispatch('loadCollections')
  • If the backend request for the message body is faster, than loading the principal and collections, then Imip.fetchExistingEvent runs without having calendars and changes existingEventFetched to true that prevents the method from running again.
  • Solution: Render the imip component when principal and collections are fetched.

Commit d677ce7

Accepting a calendar invitation should always go to a writable calendar, and therefore we can skip the check if the event exists in a read-only calendar.

@kesselb kesselb self-assigned this Aug 20, 2024
@kesselb kesselb added this to the v4.0.0 milestone Aug 20, 2024
@kesselb kesselb requested a review from st3iny August 20, 2024 11:58
@kesselb kesselb changed the title Perf/noid/improve imip calendar integration fix: wrong attendance status for imip events Aug 20, 2024
@kesselb kesselb force-pushed the bug/noid/imip-for-external-organizers branch from 5c67f66 to 880eca7 Compare August 20, 2024 12:02
@kesselb kesselb force-pushed the perf/noid/improve-imip-calendar-integration branch from d677ce7 to 59caea8 Compare August 20, 2024 12:05
Base automatically changed from bug/noid/imip-for-external-organizers to main August 21, 2024 08:43
One may have imported an event, but the attendance status is not properly fetched when rendering the email.
The reason is a timing / state problem.

- Loading the user principal and collections is initialized in https://github.com/nextcloud/mail/blob/6fc45eb0630b9065f9ccb4c1da5cc9557f7df834/src/App.vue#L49-L50.
- If the backend request for the message body is faster, than loading the principal and collections, then Imip.fetchExistingEvent runs without having calendars and changes existingEventFetched to true that prevents the method from running again.
- Solution: Render the imip component when principal and collections are fetched.

Signed-off-by: Daniel Kesselberg <[email protected]>
Accepting a calendar invitation should always go to a writable calendar, and therefore we can skip the check if the event exists in a read-only calendar.

Signed-off-by: Daniel Kesselberg <[email protected]>
@kesselb kesselb force-pushed the perf/noid/improve-imip-calendar-integration branch from 59caea8 to 4296585 Compare August 21, 2024 08:53
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Looks good, as discussed in our call.

@st3iny st3iny merged commit f23e9bd into main Sep 2, 2024
28 checks passed
@st3iny st3iny deleted the perf/noid/improve-imip-calendar-integration branch September 2, 2024 05:50
@kesselb
Copy link
Contributor Author

kesselb commented Sep 3, 2024

/backport to stable3.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants