Merged
Conversation
...twenty-server/src/database/commands/upgrade-version-command/1-10/1-10-flush-cache.command.ts
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds a new upgrade command to flush workspace cache for version 1.10, extending the ActiveOrSuspendedWorkspacesMigrationCommandRunner base class. The command calls WorkspaceCacheStorageService.flush() to clear both versioned metadata and workspace-specific cache keys.
Critical Issues Found:
- Wrong directory location: File is placed in
1-8/folder but is for version 1.10 - Missing module registration:
FlushCacheCommandis not registered in any module's providers/exports, making it non-functional - Incorrect command name: Uses
upgrade:1-8:flush-cacheinstead ofupgrade:1-10:flush-cache - Non-standard filename: Missing
.commandsuffix used by other upgrade commands
Required Changes:
- Move file to
packages/twenty-server/src/database/commands/upgrade-version-command/1-10/ - Rename to
1-10-flush-cache.command.ts - Update command decorator name to
upgrade:1-10:flush-cache - Register in
V1_10_UpgradeVersionCommandModule(providers and exports) - Import
WorkspaceCacheStorageModulein the module imports
The implementation logic itself is sound - it follows established patterns and correctly delegates to the workspace cache storage service.
Confidence Score: 0/5
- This PR cannot be merged - the command will not work at all due to missing module registration
- Score of 0 reflects critical deployment blockers: the command is in the wrong directory for the wrong version (1-8 vs 1-10), has an incorrect command name, lacks required module registration making it completely non-functional, and doesn't follow the established naming convention. These are not minor style issues but fundamental problems that prevent the feature from working.
- The single file
1-8-flush-cache.tsrequires immediate attention - it needs to be moved to the correct directory, renamed, have its command name updated, and be properly registered in the module system before this PR can be merged.
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| packages/twenty-server/src/database/commands/upgrade-version-command/1-8/1-8-flush-cache.ts | 0/5 | New cache flush command with critical issues: wrong directory (1-8 vs 1-10), missing module registration, incorrect naming convention |
Sequence Diagram
sequenceDiagram
participant CLI as CLI Executor
participant CMD as FlushCacheCommand
participant Base as ActiveOrSuspendedWorkspacesMigrationCommandRunner
participant ORM as TwentyORMGlobalManager
participant Cache as WorkspaceCacheStorageService
participant Redis as Cache Storage
CLI->>CMD: Execute upgrade:1-8:flush-cache
CMD->>Base: runMigrationCommand()
Base->>Base: fetchActiveWorkspaceIds()
loop For each workspace
Base->>ORM: getDataSourceForWorkspace(workspaceId)
ORM-->>Base: dataSource
Base->>CMD: runOnWorkspace({workspaceId})
CMD->>Cache: flush(workspaceId)
Cache->>Redis: Delete versioned metadata keys
Cache->>Redis: Delete workspace cache keys
Redis-->>Cache: Confirmation
Cache-->>CMD: Flush complete
CMD-->>Base: Workspace processed
Base->>ORM: destroyDataSourceForWorkspace(workspaceId)
end
Base-->>CLI: Migration report (success/fail)
1 file reviewed, 4 comments
...twenty-server/src/database/commands/upgrade-version-command/1-10/1-10-flush-cache.command.ts
Outdated
Show resolved
Hide resolved
...twenty-server/src/database/commands/upgrade-version-command/1-10/1-10-flush-cache.command.ts
Show resolved
Hide resolved
...twenty-server/src/database/commands/upgrade-version-command/1-10/1-10-flush-cache.command.ts
Outdated
Show resolved
Hide resolved
...twenty-server/src/database/commands/upgrade-version-command/1-10/1-10-flush-cache.command.ts
Outdated
Show resolved
Hide resolved
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:36709 This environment will automatically shut down when the PR is closed or after 5 hours. |
...er/src/database/commands/upgrade-version-command/1-10/1-10-upgrade-version-command.module.ts
Show resolved
Hide resolved
charlesBochet
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.