Skip to content

Comments

feat: KEEP-1494 merge Safe plugin into Safe protocol integration#417

Open
taitsengstock wants to merge 5 commits intostagingfrom
feature/KEEP-1494-Safe-protocol
Open

feat: KEEP-1494 merge Safe plugin into Safe protocol integration#417
taitsengstock wants to merge 5 commits intostagingfrom
feature/KEEP-1494-Safe-protocol

Conversation

@taitsengstock
Copy link
Collaborator

No description provided.

@techops-services techops-services deleted a comment from github-actions bot Feb 24, 2026
@techops-services techops-services deleted a comment from github-actions bot Feb 24, 2026
Unify the safe-wallet protocol and safe plugin under a single "safe"
integration type. The safe plugin now injects its get-pending-transactions
action + credentials into the protocol-registered integration instead of
registering a separate one.

- Rename protocol slug, files, icon, and test
- Add backward-compat legacy mappings for safe-wallet/* step IDs
- Fix discover-plugins: register protocols before plugin imports,
  route non-protocol steps correctly under protocol integrations
- Add DB migration to update existing workflow nodes
- Merge safe-wallet docs into safe docs
taitsengstock and others added 2 commits February 24, 2026 16:22
Migration 0024 referenced "workflow" (singular) but the actual table
is "workflows" (plural), causing all UPDATE statements to silently
match zero rows.
@suisuss
Copy link

suisuss commented Feb 24, 2026

Code Review

Fixed

  • Migration 0024 wrong table name -- All 4 UPDATE statements referenced "workflow" (singular) but the actual table is "workflows" (plural). Every statement was a silent no-op. Fixed in 6fde01d.

Bugs / Correctness

  1. limit param not validated in /api/analytics/runs -- Number(limitParam) can produce NaN or negative values. Math.min(NaN, 100) returns NaN which gets passed to the DB query. Needs a Number.isFinite(limit) && limit > 0 guard.

  2. Cursor pagination is fragile -- Uses startedAt timestamp as the cursor. Two executions at the same millisecond will cause skipped or duplicated rows at page boundaries. Should use a composite (startedAt, id) cursor.

  3. Safe plugin injection silently fails -- keeperhub/plugins/safe/index.ts mutates the registry at import time. If getIntegration("safe") returns null (e.g. registration order changes), the get-pending-transactions action silently disappears. The if (safeProtocol) guard swallows the error. Should throw or log an error.

Design Concerns

  1. Dead code in SSE client -- use-analytics.ts handles new-run and run-updated event types, but the server stream only ever emits summary and heartbeat. These client branches are dead code.

  2. cancelled mapped to error -- normalizeStatus treats cancelled runs as errors, inflating the error rate metric. If cancellation is user-initiated it shouldn't count as a failure.

  3. SSE polling cost -- getAnalyticsChecksum runs 3 separate aggregation queries every 2 seconds per open SSE connection. Potential read amplification at scale with multiple users on the analytics page.

  4. Spend cap gauge goes stale -- Fetches once on mount, not refreshed by SSE/polling. Data becomes stale if the page stays open.

Code Quality

  1. formatGasAsEth duplicated across kpi-cards.tsx, gas-breakdown-chart.tsx, and runs-table.tsx. Should be extracted to a shared utility.

  2. formatDuration duplicated in kpi-cards.tsx and runs-table.tsx.

  3. Stale specs -- specs/merge-safe-integrations.md still references safe-wallet/get-pending-transactions but the implementation uses safe/get-pending-transactions.

Copy link

@suisuss suisuss left a comment

Choose a reason for hiding this comment

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

Requesting changes -- please address the bugs and code quality issues from the review comment before merging

@techops-services techops-services deleted a comment from github-actions bot Feb 24, 2026
@github-actions
Copy link

❌ E2E Tests Failed

E2E tests have been run against the deployed PR environment.

Environment: app-pr-417.keeperhub.com
Status: failure
Workflow Run: View Details

⚠️ Check the workflow run for test failure details and screenshots.

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