-
Notifications
You must be signed in to change notification settings - Fork 173
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 that prevented new contacts from being saved #1416
Conversation
Before, when creating a new contact the previously selected contact would still be the 'localContact'. That happened because the 'contact' watcher would be called twice (once with the new, once with the old contact). Adding a check whether the selected contact has actually changed remedies that. Signed-off-by: Christian Kraus <hanzi@hanzi.cc>
Codecov Report
@@ Coverage Diff @@
## master #1416 +/- ##
=======================================
Coverage 62.31% 62.31%
=======================================
Files 4 4
Lines 69 69
=======================================
Hits 43 43
Misses 26 26 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, this doesn't hurt :)
We encounter the same issue as hanzi wrote, but for us it only began when updating to Contacts 3.1.8 from the GUI within Nextcloud 17.0.2 - no compiling or building anything ourselves. It actually appeared in three of our deployments, all managed servers and one shared hosting at the provider Hetzner. |
@DBJRdev That's odd -- this fix is already included in 3.1.8 and I don't have this issue anymore with Contacts 3.1.8 on Nextcloud 17.0.3. Could you open a new issue with some more details (including the browser log)? |
Hey! Because on the first save to server, we do not update the real full contact anymore. The Fix incoming |
Whenever I would compile the JavaScript sources myself, I would run into an issue when creating a new contact:
I can't reproduce this bug with the released version -- though it would still happen if I compiled the JavaScript from the
v3.1.7
,v3.1.6
orv3.1.5
tags myself. So I'm not sure whether this might be an issue with some dependency or I'm just doing something wrong.Anyway, the issue as far as I could tell is that the
contact
watcher of theContactDetails
component fires twice when a new contact is added: once with the new contact and once with the old one. This eventually leads tolocalContact
being overwritten with the old one, so that all save actions actually just save the old contact.This PR fixes this behaviour by adding a check whether the new contact (inside the watcher) is actually different from the old one. I don't really like this fix because it only attacks the symptom and I still don't have any idea why the watcher is fired twice to begin with.
But at least this way the app is usable again for me.