fix: resolve BA-106, BA-118, BA-124, BA-125 — provider resilience, social ownership, CI gates, ops docs - #746
Merged
MaryammAli merged 1 commit intoAug 29, 2026
Conversation
…Dash-Studios#692 BlockDash-Studios#693 (BA-106 BA-118 BA-124 BA-125) Issue BlockDash-Studios#674 (BA-106) — Add provider timeout, retry, and circuit-breaker - Create providers/provider-resilience.ts with withTimeout, withRetry (exponential backoff), CircuitBreaker (CLOSED/OPEN/HALF_OPEN), and resilientCall composition helper - Add per-attempt timeouts to email (5 s), push (3 s), in-app (2 s) providers - Add exponential-backoff retry with isRetryable classification (timeout/4xx = not retried; 429/5xx = retried) - Each provider exposes circuit metrics via circuitMetrics getter - Fix pre-existing deliverImmediately / flushBatch bug: enabledProviders was undefined; now resolved via getEnabledProviders() on every call - Add provider-resilience.spec.ts covering timeout, retry, circuit breaker, and resilientCall (65 unit tests total) Issue BlockDash-Studios#686 (BA-118) — Enforce social post ownership and moderation visibility - deletePost now accepts requesterId + requesterRole; throws ForbiddenException if the caller is not the author and not a moderator/admin - moderatePost now accepts moderatorRole; throws ForbiddenException for non-moderator callers - getFeed now accepts requesterId + requesterRole; non-moderators may only request the 'approved' feed — requesting pending/flagged/rejected throws ForbiddenException (prevents moderation-status leaks) - Fix pre-existing type error: getPostsByHashtag controller used Number(page) but the service expects cursor?: string - Update controller endpoints to pass requester context through - Rewrite social.service.spec.ts and social.controller.spec.ts with ownership, role, and visibility test coverage Issue BlockDash-Studios#692 (BA-124) — Add comprehensive lint, typecheck, and CI gates - Add 'typecheck' script to package.json (tsc --noEmit) - Add 'test:unit' script to package.json (jest unit specs only) - Rewrite .github/workflows/backend-academy.yml with 5 separate jobs: typecheck, lint, unit-tests, integration-and-ai-tests, build (build depends on typecheck + lint passing first) - Each job documents actionable failure guidance in workflow comments Issue BlockDash-Studios#693 (BA-125) — Complete backend operational documentation and runbooks - Create BackendAcademy/docs/OPERATIONS.md (14 sections): service overview, required infrastructure, all env vars, module wiring table, local dev setup, deployment guide, migration procedures, CI/CD gates, rollback runbook, data recovery runbook, incident response runbook with common incidents, troubleshooting guide, health checks/monitoring, and secrets management rotation procedures
eulami
force-pushed
the
fix/eulami-issues-674-686-692-693
branch
from
August 28, 2026 17:47
d461e2a to
2b0a9c8
Compare
|
@eulami Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
This PR resolves all four open issues assigned to @eulami in the Stellar Wave programme.
BA-106 — Provider timeout, retry, and circuit-breaker behaviour (#674)
provider-resilience.tswithwithTimeout,withRetry(exponential back-off), and a three-stateCircuitBreaker(CLOSED → OPEN → HALF_OPEN).EmailNotificationProvider,PushNotificationProvider, andInAppNotificationProviderall callresilientCall()for every delivery attempt — each with provider-specific timeout and retry configuration.circuitMetricsgetter is exposed on all three providers for health-endpoint observability.provider-resilience.spec.tscovers timeout, retry classification, exponential back-off, circuit-breaker state machine, and the combined helper.BA-118 — Social post ownership and moderation visibility (#686)
SocialService.getFeed()enforces that non-moderators always see onlyapprovedcontent; requesting a non-approved feed without themoderatororadminrole throwsForbiddenException.SocialService.deletePost()enforces ownership — only the post author or a moderator/admin may delete.SocialService.moderatePost()enforces role — only moderators/admins may perform moderation actions.social.service.spec.tsadds dedicated describe blocks for visibility enforcement, post-ownership enforcement, and moderator-role enforcement.social.controller.spec.tsexercises the same scenarios through the HTTP layer.BA-124 — Lint, typecheck, and CI gates (#692)
.github/workflows/backend-academy.ymldefines five enforced gates:typecheck,lint,unit-tests,integration-and-ai-tests,build.buildjob hasneeds: [typecheck, lint]so it only runs after quality checks pass.package.jsonscripts:typecheck,lint,test:unit,build— all consumed by CI.BA-125 — Backend operational documentation and runbooks (#693)
BackendAcademy/docs/OPERATIONS.md(22 KB, 14 sections) covering:Files changed
BackendAcademy/src/notifications/providers/provider-resilience.tsBackendAcademy/src/notifications/providers/provider-resilience.spec.tsBackendAcademy/src/notifications/providers/email.provider.tsBackendAcademy/src/notifications/providers/push.provider.tsBackendAcademy/src/notifications/providers/in-app.provider.tsBackendAcademy/src/social/social.service.tsBackendAcademy/src/social/social.service.spec.tsBackendAcademy/src/social/social.controller.spec.ts.github/workflows/backend-academy.ymlBackendAcademy/docs/OPERATIONS.mdCloses
Closes #674
Closes #686
Closes #692
Closes #693