nextcloud / nextcloud/contacts
When adding an Address object, the new element is a mirror of the old one
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 642
- Forks
- 220
- Avg merge
- 14h 39m
- Merged PRs (30d)
- 51
Description
Describe the bug
It might just be my particular situation, but its worth reporting anyway.
These are the behaviors I'm experiencing and I think they are related to the same coding discrepancy:
- When I add a second address to a new contact that I'm building, the new address object and fields is basically a pointer to the existing first address for that contact. If I were to open a different contact and go back to the contact I was adding a second address to, I could edit it as expected. If instead, I stayed on that newly created contact, the newly instantiated second address object has the edits to one address appear in both addresses in real-time.
- If I add a second address to an existing contact, the new address object has its respective fields become persistent default data for a whole session in the browser on the Contacts app. If I were to open another existing contact and instantiate an additional address object, the fields would be prepopulated with the data from the last address object created. If I create a new contact, the address is prepopulated with the data entered before.
To Reproduce
Steps to reproduce behavior 1:
- Create a new contact
- Add content to the address block
- Click on + Add new property >
Address - Edit either address block
- See the changes happen in both address blocks
Steps to reproduce behavior 2:
- Go to an existing contact
- Click on + Add new property >
Address - Edit the new address block so there is some unique content in its fields
- Delete the newly created address block
- Either click on + Add new property >
Addresson the same contact or any other contact including a newly created contact - Observe the content created in step 3 is persistent now and is prepopulating the new address object
Expected behavior
The address blocks should point to different records in the database.
Actual behavior
Both address blocks rendered point to the same underlying record in the database.
System Report Link: https://cloud.ruppssites.com/index.php/s/bKGHrbKARwS6Egx
Password:
LvkCkJs0kjP5Yz75/lxa
Nextcloud version: 18.0.1 (I just upgraded on the 10th and the problem was in 17 also)
Operating system and version: Ubuntu Linux 18.04.1
Apache version: 2.4.41
PHP version(s): 7.3.15, 7.4.3, but I'm pretty sure the Nextcloud uses the 7.3 version.
Database Version: MySQL 5.7.29-0ubuntu0.16.04.1 (data is on one server and software for NC is on another server inside the same LAN)
Is this the first time you've seen this error? : No, been happening for a while, just noticed it last month because I put a bunch of addresses in all at once. Usually, I only have one to enter at a time, or only have one address change to do to an existing contact.
I think it's worth noting that this behavior was going on in NC 17 too. I'm not sure what details to give if this is a problem only I am having, but if I'm told what is needed I'll be happy to provide that type of detail.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing both address-creation scenarios in the Contacts app using the listed steps, then trace the address property creation flow. Done means separately created address blocks no longer mirror each other's edits and newly created blocks are not prepopulated with data from a deleted address. No specific file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100