feat: webhook integration, markdown parser, decentralized storage & multi-sig timelock - #743
Merged
ayomideadeniran merged 1 commit intoJun 24, 2026
Conversation
…torage, and multi-sig timelock
Closes #682 - Webhook integration for lesson completions
Closes #676 - Markdown/MDX content parser service
Closes #681 - Decentralized storage endpoint for lesson content
Closes #691 - Multi-sig timelock contract upgrade to Soroban SDK v22
## Changes
### Issue #682 — Webhook Integration (backend)
- Added WebhookSubscription model to Prisma schema with workspaceId, url,
secret, events (JSON), and active fields
- Added StudentActivity model for webhook event payloads
- Implemented webhook subscription CRUD routes (POST/GET/DELETE
/api/v1/webhooks/subscriptions) in backend/src/routes/webhooks.ts
- Mounted webhook router at /api/v1/webhooks in routes/index.ts
- Triggered lesson.completed webhook events in updateStudentProgress when
a student completes a new lesson for the first time
- Fixed Jest mock queue pollution bug in progress.unit.test.ts
### Issue #676 — Markdown/MDX Parser Service (backend)
- Implemented MarkdownParserService in src/services/markdownParser.service.ts
using marked (v15) for parsing and sanitize-html for XSS protection
- Extracts code blocks, strips MDX JSX components, and returns structured
{ html, codeBlocks, readingTimeMinutes } output
### Issue #681 — Decentralized Storage Endpoint (backend)
- Added GET /api/v1/learning/courses/:courseId/lessons/:lessonId/content route
that resolves IPFS CIDs from DecentralizedAsset records in the database
- Fetches content from configurable IPFS gateway with Redis caching (1-hour TTL)
- Parses fetched Markdown content through MarkdownParserService before returning
### Issue #691 — Multi-Sig Timelock Contract (contracts)
- Added multisig_wallet_timelock crate to workspace Cargo.toml
- Implemented Soroban SDK v22 compatible multisig timelock contract:
* submit_proposal, approve_proposal, execute_proposal with configurable
signer threshold and timelock delay
* require_auth() instead of deprecated env.invoker()
* Bytes storage instead of Vec<u8> for SDK v22 compatibility
- Added 9 comprehensive tests covering full proposal lifecycle
### Additional Fixes
- Fixed Soroban SDK v22 test failures in proxy contract by registering real
compiled WASM via env.deployer().upload_contract_wasm() instead of dummy hashes
- Fixed smart_vault tests that triggered archived-instance errors by reducing
ledger sequence increments to stay within the default test TTL window
- Made database SSL connection optional for local/test environments
|
@rhoggs-bot-test-account is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@adeniran19-maker 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 implements all four requested features in a single submission, ready for maintainer review and merge.
Closes #682
Closes #676
Closes #681
Closes #691
Changes by Issue
#682 — Webhook Integration for Lesson Completions
WebhookSubscriptionmodel to Prisma schema (workspaceId,url,secret,eventsJSON array,active, timestamps)StudentActivitymodel for webhook event payloads/api/v1/webhooks/subscriptions:POST /api/v1/webhooks/subscriptions— create a subscriptionGET /api/v1/webhooks/subscriptions— list subscriptions for workspaceDELETE /api/v1/webhooks/subscriptions/:id— delete a subscriptionupdateStudentProgressnow fires alesson.completedwebhook event (via the existingenqueueWebhookDeliveriesdispatcher) whenever a student completes a lesson for the first timetests/webhooks.routes.test.ts— 5/5 pass#676 — Markdown/MDX Content Parser Service
src/services/markdownParser.service.tsusingmarkedv15 for Markdown compilation andsanitize-htmlfor XSS prevention<Component />) before parsingreadingTimeMinutesfrom word count{ html, codeBlocks, readingTimeMinutes }tests/markdownParser.service.test.ts— 5/5 pass#681 — Decentralized Storage Endpoint for Lesson Content
GET /api/v1/learning/courses/:courseId/lessons/:lessonId/contentDecentralizedAssettable in the databaseIPFS_GATEWAY_URL(e.g. Pinata, Cloudflare)MarkdownParserServicetests/learning.content.test.ts— 2/2 pass#691 — Multi-Sig Timelock Contract (Soroban SDK v22)
multisig_wallet_timelockcrate to the contracts workspacesubmit_proposal(payload, threshold, delay)— creates a pending proposalapprove_proposal(proposal_id)— signers vote; auto-executes at thresholdexecute_proposal(proposal_id)— manual execution after timelock delayget_proposal(proposal_id)— read proposal staterequire_auth()(replaces deprecatedenv.invoker())Bytesstorage for payloads (SDK v22 requirement, replacesVec<u8>)cargo test -p multisig-wallet-timelockAdditional Fixes
proxy/src/tests.rs):update_current_contract_wasmrequires the WASM hash to exist on the test ledger. Replaced dummy byte arrays withenv.deployer().upload_contract_wasm()using the compiledproxy.wasmartifact — 6/6 proxy tests now passError(Storage, InternalError): Accessed contract instance key that has been archived— reduced ledger sequence increments to remain within the Soroban test environment's default TTL window — 9/9 smart_vault tests now passsrc/db/index.tsTest Results
Backend (Jest)
Contracts (cargo test --workspace)