Skip to content

Conversation

@ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Dec 29, 2021

The timestamp and the calendar order are int, but we treated them as string. With this patch
the property map is enriched with types and settype casts the value if necessary.

Ideally we migrate this DB access code to something like a QBMapper. Then these things will be taken care of for us automagically. But that is for another day.

Discovered in #30437

@ChristophWurst ChristophWurst added bug 3. to review Waiting for reviews labels Dec 29, 2021
@ChristophWurst ChristophWurst added this to the Nextcloud 24 milestone Dec 29, 2021
@ChristophWurst ChristophWurst self-assigned this Dec 29, 2021
@ChristophWurst
Copy link
Member Author

/backport to stable23

@ChristophWurst
Copy link
Member Author

/backport to stable22

@ChristophWurst ChristophWurst requested review from a team, CarlSchwan, icewind1991 and juliusknorr and removed request for a team December 29, 2021 13:25
@ChristophWurst ChristophWurst changed the title Fix column/property type of the CalDAV deleted_at time stamp Fix column/property types in CalDAV Dec 29, 2021
foreach ($this->propertyMap as $xmlName => [$dbName, $type]) {
$value = $row[$dbName];
if ($value !== null) {
settype($value, $type);
Copy link
Member

Choose a reason for hiding this comment

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

Should we handle settype returning false? Throw/log something?

Copy link
Member Author

Choose a reason for hiding this comment

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

We also don't handle it in \OCP\AppFramework\Db\Entity::setter, so I'm not sure

Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

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

LGTM, I created and deleted calendar events and calendar recurrences.

StatAna isn't happy.

@ChristophWurst ChristophWurst force-pushed the fix/caldav-trash-bin-deleted-at-int branch 2 times, most recently from eea8d01 to 2b4c91e Compare January 4, 2022 16:29
@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jan 4, 2022
@miaulalala
Copy link
Contributor

Drone failure unrelated.

@skjnldsv skjnldsv mentioned this pull request Mar 24, 2022
@ChristophWurst ChristophWurst force-pushed the fix/caldav-trash-bin-deleted-at-int branch from 2b4c91e to a7ad376 Compare March 24, 2022 16:05
@PVince81
Copy link
Member

/rebase

The timestamp is an int, but we treated it as string. With this patch
the property map is enriched with types and settype casts the value if
necessary.

Signed-off-by: Christoph Wurst <[email protected]>
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 bug

Projects

Development

Successfully merging this pull request may close these issues.

5 participants