59 lines
2.3 KiB
Markdown
59 lines
2.3 KiB
Markdown
# 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` — `storeCredential` and `revokeCredential` now delete the `health:{customerId}:{platform}` Redis cache key after writing/deleting the credential
|
|
|
|
## Schema / migration
|
|
|
|
None. Redis key deletion only.
|
|
|
|
## Deploy commands
|
|
|
|
```bash
|
|
# 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:
|
|
1. In the app, disconnect and reconnect Facebook or Instagram via the Connect modal
|
|
2. Reload the page
|
|
3. The platform card should show **Connected** (not TOKEN EXPIRED)
|
|
4. Alternatively: call `GET /api/health/platforms` immediately after `POST /api/connect/facebook` — status should be `healthy`
|
|
|
|
## 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/platforms` using `x-api-key`
|
|
|
|
### Steps performed
|
|
|
|
1. Seeded a stale `health:{customerId}:telegram` cache entry with value `expired`.
|
|
2. Called `GET /api/health/platforms` — returned `{"platform": "telegram", "status": "expired"}` (stale cache hit).
|
|
3. Called `POST /api/connect/telegram` with a fake access token — returned `{"connected": true, "platform": "telegram"}`.
|
|
4. Called `GET /api/health/platforms` again — returned `{"platform": "telegram", "status": "healthy"}` (cache busted, fresh credential status).
|
|
5. Simulated disconnect by deleting `creds:{customerId}:telegram` and `health:{customerId}:telegram` from Redis.
|
|
6. 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.
|
|
|