Skip to content

release 1.10 flush cache command#15610

Merged
charlesBochet merged 4 commits intomainfrom
release-flush-cache
Nov 4, 2025
Merged

release 1.10 flush cache command#15610
charlesBochet merged 4 commits intomainfrom
release-flush-cache

Conversation

@guillim
Copy link
Copy Markdown
Contributor

@guillim guillim commented Nov 4, 2025

No description provided.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

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: FlushCacheCommand is not registered in any module's providers/exports, making it non-functional
  • Incorrect command name: Uses upgrade:1-8:flush-cache instead of upgrade:1-10:flush-cache
  • Non-standard filename: Missing .command suffix used by other upgrade commands

Required Changes:

  1. Move file to packages/twenty-server/src/database/commands/upgrade-version-command/1-10/
  2. Rename to 1-10-flush-cache.command.ts
  3. Update command decorator name to upgrade:1-10:flush-cache
  4. Register in V1_10_UpgradeVersionCommandModule (providers and exports)
  5. Import WorkspaceCacheStorageModule in 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.ts requires 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)
Loading

1 file reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

🚀 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.

@guillim guillim enabled auto-merge (squash) November 4, 2025 16:22
@charlesBochet charlesBochet merged commit e64603e into main Nov 4, 2025
50 checks passed
@charlesBochet charlesBochet deleted the release-flush-cache branch November 4, 2025 16:29
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.

2 participants