Skip to content

Fix controlled document ID allocation - #286

Open
ArtyomSavchenko wants to merge 5 commits into
developfrom
fix-template-id
Open

Fix controlled document ID allocation#286
ArtyomSavchenko wants to merge 5 commits into
developfrom
fix-template-id

Conversation

@ArtyomSavchenko

Copy link
Copy Markdown
Collaborator

Summary
This PR fixes controlled document and template code handling during creation and workspace export.
Custom IDs such as TESTTMP-1 are now preserved during export when available, instead of being replaced with generated default codes such as TMPL-2.

Changes

  • Added a reusable identifier allocator in @hcengineering/core.
  • Added atomic identifier reservations backed by server-side transaction conditions.
  • Prevented duplicate IDs during concurrent allocation requests.
  • Supported preserving a requested custom numeric code even when the current sequence is higher.
  • Incremented to the next available code when the requested one is already occupied.
  • Updated controlled document and template creation to use the shared allocator.
  • Updated export mapping to preserve custom codes and resolve conflicts through the allocator.
  • Added migration logic to reserve identifiers of existing controlled documents.
  • Unified identifier parsing and added support for prefixes containing hyphens.
  • Removed obsolete client-side conflict-checking logic from the create-document UI.

Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
@ArtyomSavchenko
ArtyomSavchenko marked this pull request as ready for review September 1, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant