| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The field holds the owner's email for Twake and classic Cozy instances alike, so it is stored as email, indexed by-email, and the fixer and migration are named after it too. The internalEmail field of the RabbitMQ messages is the platform contract and keeps its name.
SetEmail now takes a lock on the email and checks the by-email index before writing, so two instances cannot end up with the same email, even when they are updated concurrently. The backfill reports such an email as a duplicate instead of an error, and the user.created handler logs it and acks the message, since requeuing it would loop forever.
The emails fixer already backfills every instance, with a dry run and a report of the duplicates across organizations, so it is kept as the single entry point.
Stacked on #4934. Part 2 of #4796. ## Summary The instance email is now a normalized mirror of the settings email. - `instance.SyncEmail` is the single place that copies the settings email to the instance: normalized, empty values ignored, organization instances skipped (as in the backfill). It goes through `SetEmail`, so the lock and the duplicate check of #4934 apply. An email held by another instance is logged and left out, since the settings update is already saved. - Instance creation fills the email from the settings email. - `lifecycle.Patch` syncs it on every settings update. That covers `PUT /settings/instance`, the admin instance `PATCH` and the RabbitMQ handlers, and any settings update brings back a drifted email. - `user.created` now writes the email to the settings through `lifecycle.Patch` instead of beside them, so there is a single source. - `ConfirmEmailUpdate` (the email change confirmation flow) syncs it too, through the instance service. - `SetEmail` and `FindByEmail` move from `lifecycle` to the `instance` package, so the settings service can reach them. - Fixes `instance.Mock.Update`, which read the second return value of a single-error method and panicked.
| Back | FazBrowse Home | New Git URL |
Summary