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 CalDAV update if sync is set #1703

Merged

Conversation

bertrandda
Copy link
Contributor

@bertrandda bertrandda commented Feb 1, 2023

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community for testing before merging.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

If CalDAV calendar is updated while sync, do not updated sync attribute

@codecov
Copy link

codecov bot commented Feb 1, 2023

Codecov Report

Base: 97.27% // Head: 97.28% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (4753a0c) compared to base (93e2a55).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1703      +/-   ##
==========================================
+ Coverage   97.27%   97.28%   +0.01%     
==========================================
  Files         643      645       +2     
  Lines        9689     9725      +36     
==========================================
+ Hits         9425     9461      +36     
  Misses        264      264              
Impacted Files Coverage Δ
.../caldav/lib/calendar/calendar.syncUserCalendars.js 100.00% <100.00%> (ø)
server/api/routes.js 98.03% <0.00%> (ø)
server/models/dashboard.js 100.00% <0.00%> (ø)
server/utils/httpErrors.js 100.00% <0.00%> (ø)
server/lib/gateway/index.js 100.00% <0.00%> (ø)
server/lib/dashboard/index.js 100.00% <0.00%> (ø)
server/lib/dashboard/dashboard.get.js 100.00% <0.00%> (ø)
server/lib/dashboard/dashboard.create.js 100.00% <0.00%> (ø)
server/api/controllers/dashboard.controller.js 100.00% <0.00%> (ø)
server/lib/dashboard/dashboard.getBySelector.js 100.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

await this.gladys.calendar.update(gladysCalendar[0].selector, formatedCalendar);
await this.gladys.calendar.update(gladysCalendar[0].selector, {
...formatedCalendar,
sync: gladysCalendar[0].sync,
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles Feb 3, 2023

Choose a reason for hiding this comment

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

Don't you risk to still update it wrongly if it changed between the .get and the .update ?

Why not simply removing the sync attribute from the update if it's not required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no action between get and update, so time is really, really short, I don't think change can happen. But indeed delete is a better option, more readable I changed.

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Looks better now! Thanks for the change

@Pierre-Gilles Pierre-Gilles merged commit 708b4ea into GladysAssistant:master Feb 6, 2023
@relativeci
Copy link

relativeci bot commented Feb 6, 2023

Job #1057: Bundle Size — 7.19MiB (0%).

708b4ea(current) vs 5a06a12 master#1054(baseline)

Metrics (1 change)
                 Current
Job #1057
     Baseline
Job #1054
Initial JS 4.21MiB 4.21MiB
Initial CSS 300KiB 300KiB
Cache Invalidation 0% 63.91%
Chunks 51 51
Assets 149 149
Modules 1338 1338
Duplicate Modules 1 1
Duplicate Code 0.01% 0.01%
Packages 116 116
Duplicate Packages 4 4
Total size by type (no changes)
                 Current
Job #1057
     Baseline
Job #1054
CSS 313.13KiB 313.13KiB
Fonts 93.55KiB 93.55KiB
HTML 13.58KiB 13.58KiB
IMG 1.66MiB 1.66MiB
JS 5.11MiB 5.11MiB
Media 0B 0B
Other 15.74KiB 15.74KiB

View job #1057 reportView master branch activity

@bertrandda bertrandda deleted the fix/caldav-changed-sync branch February 6, 2023 18:02
euguuu pushed a commit to euguuu/Gladys that referenced this pull request Mar 5, 2023
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.

2 participants