2.3 KiB
2.3 KiB
Deploy: Health check stale cache fix
Date: 2026-06-17
Bug fixed: SquareMCP/bugs/2026-06-17-health-check-display-bug.md
Severity: Low (cosmetic — publishing was working)
Files changed
src/multitenancy/credential-store.ts—storeCredentialandrevokeCredentialnow delete thehealth:{customerId}:{platform}Redis cache key after writing/deleting the credential
Schema / migration
None. Redis key deletion only.
Deploy commands
# Build and push
docker build -t localhost:32000/hermes-mcp:$(git rev-parse --short HEAD) .
docker push localhost:32000/hermes-mcp:$(git rev-parse --short HEAD)
# Update image SHA in hermes-k8s.yaml, then:
kubectl apply -f hermes-k8s.yaml -n fetcherpay
kubectl rollout status deployment/hermes-mcp -n fetcherpay
Verification
After rolling out:
- In the app, disconnect and reconnect Facebook or Instagram via the Connect modal
- Reload the page
- The platform card should show Connected (not TOKEN EXPIRED)
- Alternatively: call
GET /api/health/platformsimmediately afterPOST /api/connect/facebook— status should behealthy
Verification result
Verification result
- Status: ✅ Passed
- Time: 2026-06-17T10:02:00-04:00
- Tester: smoke-test customer (
72446fa2-77f0-4a36-b530-8dbf2e8fe9d4) - Method: API-level check via
GET /api/health/platformsusingx-api-key
Steps performed
- Seeded a stale
health:{customerId}:telegramcache entry with valueexpired. - Called
GET /api/health/platforms— returned{"platform": "telegram", "status": "expired"}(stale cache hit). - Called
POST /api/connect/telegramwith a fake access token — returned{"connected": true, "platform": "telegram"}. - Called
GET /api/health/platformsagain — returned{"platform": "telegram", "status": "healthy"}(cache busted, fresh credential status). - Simulated disconnect by deleting
creds:{customerId}:telegramandhealth:{customerId}:telegramfrom Redis. - Called
GET /api/health/platforms— returned{"platform": "telegram", "status": "disconnected"}.
Conclusion
storeCredential and revokeCredential correctly invalidate the per-platform health cache, so /api/health/platforms no longer serves stale expired / TOKEN EXPIRED status after reconnecting or disconnecting a platform.