Skip to content

fix(server): replace accountmongo.New with wrapper to prevent index deletion [VIZ-2228] - #119

Merged
wilfredmulenga merged 3 commits into
mainfrom
fix/add-wrapper-2
Jan 8, 2026
Merged

fix(server): replace accountmongo.New with wrapper to prevent index deletion [VIZ-2228]#119
wilfredmulenga merged 3 commits into
mainfrom
fix/add-wrapper-2

Conversation

@wilfredmulenga

Copy link
Copy Markdown
Contributor

The accountmongo.New() function was being called directly in repo.go:64, which internally called Init() methods that dropped existing indexes before creating new ones. Made a fix by creating a NewAccountRepoContainer() function that builds the account repository container from scratch using wrapper repositories that only create indexes without dropping existing ones.

Migrates account repository handling from the accountmongo package to the mongorepo package.

Introduces a new `NewAccountRepoContainer` function to encapsulate account repository initialization, ensuring compatibility with transaction support and enhanced modularity. Removes direct dependencies on accountmongo, improving maintainability and alignment with other repository structures.

Fixes initialization logic to use wrapper-based repository structures, preventing index dropping during setup.

@soneda-yuya soneda-yuya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@wilfredmulenga
wilfredmulenga merged commit 7c31f39 into main Jan 8, 2026
9 checks passed
@wilfredmulenga
wilfredmulenga deleted the fix/add-wrapper-2 branch January 8, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants