Skip to content

Fix errors related to users onboarding feature#1971

Merged
lunika merged 3 commits intomainfrom
fix/onboarding
Mar 12, 2026
Merged

Fix errors related to users onboarding feature#1971
lunika merged 3 commits intomainfrom
fix/onboarding

Conversation

@lunika
Copy link
Member

@lunika lunika commented Mar 10, 2026

Purpose

In version 4.6.0 we introduce an onboarding feature when a new user is created.
A sandbox document is created for the user
And for onboarding documents accesses were created.

On the sandbox creation we have a race condition when more than one user is created at the same time. This an issue we already had on the document creation, so we fixed it using the same solution : a transaction and a lock on the document table.

For the onboarding documents, we don't create accesses anymore; we use the link_trace table instead. So the documents must not be restricted.

Proposal

  • 🐛(backend) create a link_trace record for onboarded documents
  • 🐛(backend) manage race condition when creating sandbox document

@lunika lunika requested a review from jmaupetit March 10, 2026 17:13
@lunika lunika self-assigned this Mar 10, 2026
@lunika lunika added bug Something isn't working backend labels Mar 10, 2026
@lunika lunika force-pushed the fix/onboarding branch 4 times, most recently from a8e2ac7 to cd213f3 Compare March 12, 2026 07:31
Copy link

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have minor comments. That's brilliant 👏

"Yes!"

@lunika lunika requested a review from jmaupetit March 12, 2026 09:43
Copy link

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect

lunika added 3 commits March 12, 2026 13:51
When a user is created, we created accesses to a list of onboarding
documents. Doing this have side effect on the proximity search feature.
Instead of creating access, we should create link_reach
When a user is created and a sandbox document should be created, we can
have a race condition on the document creation leading to an error for
the user. To avoid this we have to manage this part in a transaction and
locking the document table
We change the strategy on how the new users have access to the
onboarding documents. We should remove all created accesses we don't
want to have anymore. There is no need to add them in the link_trace
table, they are already present in the favorites and user have already
access to it.
@lunika lunika merged commit 3cad1b8 into main Mar 12, 2026
26 of 27 checks passed
@lunika lunika deleted the fix/onboarding branch March 12, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants