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

Merged Front contacts cause problems #760

Open
rgalanakis opened this issue Feb 6, 2025 · 0 comments · May be fixed by #761
Open

Merged Front contacts cause problems #760

rgalanakis opened this issue Feb 6, 2025 · 0 comments · May be fixed by #761
Assignees
Labels
bug Something isn't working

Comments

@rgalanakis
Copy link
Member

When contacts are merged or deleted, if the deleted contact is the one the backend is associated with, our code errors trying to update a non-existing contact.

Instead, we should use the phone number as the handle to update the contact.

  • Use the presence of frontapp_contact_id to determine if a user's phone number has ever been sent to Front. We CANNOT assume the ID is valid anymore.
  • Change FrontappAttributes#contact_id to use the alt handle, like alt:phone:+12223334444
  • In FrontappAttributes#_update_contact and _create_contact, use the alt handle.
  • In FrontappAttributes#_create_contact, if an error Frontapp::ConflictError is raised, then save a frontapp_contact_id of the error's message (just the whole message, we don't care about the value of this field anymore), and fall back to calling _update_contact. This will happen when the contact already exists in Front.
  • In FrontappAttributes#_update_contact, if an error Frontapp.NotFoundError is raised, then clear out frontapp_contact_id, and fall back to calling _create_contact. This will happen when a phone number is changed and it does not exist in Front.
  • Change ListSync to use the alt id. You will need to select members, rather than select_map.
@rgalanakis rgalanakis added the bug Something isn't working label Feb 6, 2025
@DeeTheDev DeeTheDev linked a pull request Feb 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants