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 issue with Attendee not being string crashing tooltip #5170

Merged
merged 3 commits into from
May 4, 2023

Conversation

masonbrothers
Copy link
Contributor

There is an issue when you upload a new ics file to nextcloud calendar that does not contain attendees.

Since there is an assumption that the attendee is going to be a string (and not undefined), the tooltip crashes when you try to edit an event.

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at b9 (attendee.js:30:10)
    at o.userAsAttendee (EditorMixin.js:234:22)
    at e.get (vue.runtime.esm.js:3446:33)
    at e.evaluate (vue.runtime.esm.js:3547:27)
    at o.userAsAttendee (vue.runtime.esm.js:5537:25)
    at o.isViewedByAttendee (EditorMixin.js:222:16)
    at e.get (vue.runtime.esm.js:3446:33)
    at e.evaluate (vue.runtime.esm.js:3547:27)
    at o.isViewedByAttendee (vue.runtime.esm.js:5537:25)
    at o.<anonymous> (EditSimple.vue:1:4915)

This PR should fix this by coercing non strings to become strings.

Signed-off-by: Mason Brothers <brothers.mason@gmail.com>
@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Patch coverage: 9.89% and project coverage change: +0.03 🎉

Comparison is base (2687af3) 22.42% compared to head (12deb19) 22.46%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5170      +/-   ##
============================================
+ Coverage     22.42%   22.46%   +0.03%     
  Complexity      373      373              
============================================
  Files           237      237              
  Lines         11570    11575       +5     
  Branches       2174     2176       +2     
============================================
+ Hits           2595     2600       +5     
  Misses         8975     8975              
Flag Coverage Δ
javascript 13.94% <9.89%> (+0.03%) ⬆️
php 63.94% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nts/AppNavigation/CalendarList/CalendarListNew.vue 0.00% <0.00%> (ø)
...ponents/Subscription/HolidaySubscriptionPicker.vue 0.00% <0.00%> (ø)
src/store/calendars.js 0.00% <0.00%> (ø)
src/services/caldavService.js 31.74% <31.25%> (ø)
src/utils/attendee.js 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@miaulalala miaulalala added 4. to release Ready to be released and/or waiting for tests to finish blocked This ticket or PR is blocked by another one and removed blocked This ticket or PR is blocked by another one labels May 3, 2023
src/utils/attendee.js Outdated Show resolved Hide resolved
Nice!

Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com>
Signed-off-by: Mason Brothers <masonbrothers@users.noreply.github.com>
src/utils/attendee.js Outdated Show resolved Hide resolved
Signed-off-by: Mason Brothers <masonbrothers@users.noreply.github.com>
@miaulalala miaulalala merged commit 8880e01 into nextcloud:main May 4, 2023
@miaulalala
Copy link
Contributor

Thanks for the PR!

@miaulalala
Copy link
Contributor

/backport to stable3.5

@pierreozoux
Copy link
Member

Thanks a lot \o/ Have a wonderful weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish backport-request A backport was requested for this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants