Giter Site home page Giter Site logo

Comments (4)

tiblu avatar tiblu commented on July 19, 2024 1

Release no. 1 - 21.02.2022 17:00

Released fixes so that no more new caseSensitive e-mails would appear in the DB.

Migration to come later.

from citizenos-api.

tiblu avatar tiblu commented on July 19, 2024 1

Migration

The migration logic will be following:

  • Find all Users with duplicate e-mails with different capitalization.
  • Find which account of the duplicates has most Activities.
  • Mark all other accounts as deleted. (deletedAt).
  • Record account delete activity with the reference to the migration.

Why we do not migrate data to 1 account from the duplicates?

  1. Most likely the most active account is the one that sees use.
  2. It is likely that if User was invited, they did not see the invitation anyway due to the capitalization difference in e-mail and was re-invited.
  3. We cannot alter vote history.
  4. Resolving conflicts where User has access to a resource with different accounts is going to be expensive.

TLDR: Migration const vs benefit ratio makes it unfeasible.

from citizenos-api.

tiblu avatar tiblu commented on July 19, 2024 1

Release 05.03.2022 01:27 - Migration

https://github.com/citizenos/citizenos-api/blob/37decc3c2747ae53197115e8a566759a3180eaf8/db/migrations/20220228174313-duplicate-email-users-issue-234.js

  • DB backup - b2299
  • Unique Users migrated: 36
  • Total Users marked as deleted: 37

NOTE!: IF by any chance we still end up creating Users with NOT lowercased e-mails, this migration can be re-run.

How can I spot a migrated User?

  • Migrated Users - SELECT id, email FROM "Users" WHERE "email" SIMILAR TO '%\_\_migrated\_\d{1,}';
  • Activities - SELECT COUNT(1) FROM "Activities" WHERE data->>'__migrationId' = '20220228174313-duplicate-email-users-issue-234.js';

from citizenos-api.

anettlinno avatar anettlinno commented on July 19, 2024

Triage 60. Important update. Est. dev. time 8 hours. Sending to development.

from citizenos-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.