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

Birthday events created while importing contacts should be deleted if addressbook containing the corresponding contact is deleted #1506

Closed
nursoda opened this issue Sep 25, 2016 · 16 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: caldav Related to CalDAV internals feature: dav needs info

Comments

@nursoda
Copy link

nursoda commented Sep 25, 2016

I'm not sure if it's correct in "server" component - but it does not only affect calendar or contacts, so it's either both - or "server", thus I report it here. Feel free to point me to re-insert it somewhere else.

Steps to reproduce

  1. create a dummy address book
  2. import "test.vcf" containing a contact that has birthday data to address book "Contacts"
  3. delete address book "Contacts"
  4. re-create address book "Contacts"
  5. (re)import "test.vcf"

Expected behaviour

Deleting the address book should recursively delete all contacts, and while doing so, delete all previously created birthday events.

Actual behaviour

Deleting the address book leads to stale birthday events in calendar that cannot be deleted (and, even worse, also have reminders (valarms) set.

Steps to recover

How to get rid of stale events? Should I edit the nexcloud database. How (without harming consistency)? My idea is to

  1. export contacts from address book "Contacts"
  2. delete the address book "Contacts" (this step requires any other address book to exist -> see step 0. above)
  3. (re)create address book "Contacts" (empty)
  4. delete all birthday events (HERE's where I don't know how)
  5. (re)import the contacts to main addressbook "Contacts" (which (re)creates the birthday events).

Server configuration

Debian jessie fully patched, Apache 2.4.10 prefork, PHP 5.6.24, MySQL 5.5.52, Nextcloud 10.0 (stable) freshly installed via Webinstaller.

Cross references

@nickvergessen
Copy link
Member

As written in the forum, the following command should solve the issue:

./occ dav:sync-birthday-calendar

But since you have no console access, I'm not sure if something is possible to fix this atm.

@nursoda
Copy link
Author

nursoda commented Sep 27, 2016

Thanks!
I do have console access.

Does that command rebuild the birthday calendar from scratch (delete all its events and re-create them from the contacts) or does it search for duplicates and remove them?

I think I found a workaround for those without console access:

  • export all contacts
  • delete all contacts
  • delete the birthday calendar
  • import all contacts

@nickvergessen
Copy link
Member

As far as I can judge from my quick look, it only adds/updates entries

@Micha-Btz
Copy link

Micha-Btz commented Oct 3, 2016

after some tests i can get database access if I use

'dbhost' => '127.0.0.1', in config.php - localhost didn't work.

so I'm able to run the command

ich@owncloud/htdocs$ ./occ dav:sync-birthday-calendar
Start birthday calendar sync for all users ...
2 [============================]

sadly the problem did not solve. I still have to birthday entry's in calendar. what if i'am delete the calendar completely and let it create new?

@nickvergessen
Copy link
Member

sadly the problem did not solve. I still have to birthday entry's in calendar. what if i'am delete the calendar completely and let it create new?

That should work...

@nickvergessen nickvergessen added this to the Nextcloud 11.0 milestone Oct 4, 2016
@Micha-Btz
Copy link

for me it is solved with deleting the contact birthday calendar.
and let it create new with ./occ dav:sync-birthday-calendar.

@nursoda
Copy link
Author

nursoda commented Oct 5, 2016

Good to know there's a workaround. The bug is about proper deletion, though. Not sure whether triggering both "delete all birthday calendars" and "./occ dav:sync-birthday-calendar" is is a safe solution.

Another way to solve it could be to provide a selection mechanism for contacts (which is a good idea for other tasks, too, such as putting many contacts in a group, or exporting them) so that users may delete all contacts from their address book. When single contacts are deleted, it sould be possible to trigger deletion of the birthday cal entries the same way as they are created. This would need to be accompained by a mechanism that prohibits deletion of an address book as long as it still contains contacts.

@MorrisJobke MorrisJobke removed this from the Nextcloud 12.0 milestone May 15, 2017
@nursoda
Copy link
Author

nursoda commented Dec 19, 2017

Should this bug be closed? It's not implemented yet, is it?

@ThomasLeister
Copy link

ThomasLeister commented Dec 20, 2017

Yes, it's not implemented yet. But I'd appreciate very much if automatic deletion of birthdays in calendar was available :)

A workaround is no solution.

@Daryes
Copy link

Daryes commented May 7, 2018

For those who face the same bug, it might be useful to know the occ command has a different behavior when called globally or with a username (at least on NC v13.0.1)

After deleting the anniversary calendar for a specific user, running occ globally :

$ ./occ dav:sync-birthday-calendar
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Start birthday calendar sync for all users ...
 (...)

While the command was successful, the deleted calendar isn't rebuilt. Even more, checking the calendars table from the DB will confirm the command didn't work.

Instead, using it with the username will have the expected result :

$ ./occ dav:sync-birthday-calendar 'specific_username'
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Re-enabling birthday calendar for specific_username
Start birthday calendar sync for specific_username

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@SUECHTI
Copy link

SUECHTI commented Jul 7, 2018

I´m sorry, but
./occ dav:sync-birthday-calendar 'specific_username'
did not helped me.
My Birthday Calendar is absent anyway..
i´ve done these Steps:

  • export all contacts
  • delete default contacts
  • delete the birthday calendar
  • create new Calendar 'default2'
  • import all contacts
  • run ./occ dav:sync-birthday-calendar
    (here php is using some processor for a minute, statusbar moving for every NC User)
    -run ./occ dav:sync-birthday-calendar 'my_user'
    Start birthday calendar sync for 'my_user'
    the process is instant finished, no cpu was used
    but my Birthday-Calendar does not appear :(

using NC 13.0.4

@gohrner
Copy link

gohrner commented Sep 26, 2018

I ran into this bug using NextCloud 14.0.1.

For me,

php occ dav:sync-birthday-calendar 'specific_username'

worked and re-enabled the birthday calender, which I had to delete before as it was messed-up with duplicate entries.

OTOH,

php occ dav:sync-birthday-calendar

was not sufficient.

@skjnldsv
Copy link
Member

skjnldsv commented Jun 5, 2019

@georgehrke :)

@skjnldsv skjnldsv added 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info labels Jun 5, 2019
@georgehrke
Copy link
Member

Ok, so this is not one bug, but multiple ones:

@georgehrke georgehrke added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info labels Jun 5, 2019
@cristarta
Copy link

for me it is solved with deleting the contact birthday calendar.
and let it create new with ./occ dav:sync-birthday-calendar.

This workaround allowed me to fix this outstanding issue on my Nextcloud v19 installation. I've written up a novice friendly procedure in case others stumble on this thread - like I originally did.

@ChristophWurst ChristophWurst added the feature: caldav Related to CalDAV internals label Dec 17, 2021
@szaimen
Copy link
Contributor

szaimen commented Nov 26, 2022

Hi, please update to at least 23.0.12 and report back if it fixes the issue. Thank you!

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Nov 26, 2022
@szaimen szaimen closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: caldav Related to CalDAV internals feature: dav needs info
Projects
None yet
Development

No branches or pull requests