[Backend] Standardize X-Request-ID header propagation across Express middlewares and error responses
Overview
Distributed debugging requires tracing a request from client to server logs. Currently, incoming X-Request-ID headers are partially attached in some routes but omitted in error handlers.
Problem
- When an API error occurs, client cannot report their request ID to support engineers because error responses omit
X-Request-ID.
Proposed Changes
- Add an early middleware in
backend/src/app.tsto assign or preservereq.id = req.headers['x-request-id'] || crypto.randomUUID(). - Ensure
res.setHeader('X-Request-ID', req.id). - Include
requestIdin error payloads returned byapi-error.ts.
Acceptance Criteria
- [ ] Every response includes
X-Request-IDheader. - [ ] Error responses include
requestIdproperty in JSON body. - [ ] Winston logs automatically append
requestId.
@Sam-Adey has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
Hi Maintainer, I'd like to help standardize "X-Request-ID" propagation across the FlowFi backend. I can add the early middleware to preserve an incoming request ID or generate one when absent, ensure it is returned on every response, include it in API error payloads, and attach it to Winston logs for consistent request tracing. I’ll also verify the behavior across normal and error responses.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Sam-Adey to this issue.
@Chinko21 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
I would like to fix this
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Chinko21 to this issue.
Congratulations, @Chinko21! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @Chinko21: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been removed from the Stellar Wave Program by the repository maintainers.
@Chinko21, you have been unassigned from this issue. If you have any questions, please reach out to the repo maintainers.
@Hustler490 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hello, I’ve carefully reviewed the requirements and believe I can deliver a proper solution that satisfies the acceptance criteria. Please assign it to me.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Hustler490 to this issue.
@Raheemah2k26 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hi maintainer, I can get this issue fixed quickly. Please assign it to me
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Raheemah2k26 to this issue.
Congratulations, @Raheemah2k26! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
🧑💻 @Raheemah2k26: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @Raheemah2k26 as part of the Stellar Wave Program's 11th Wave 🥳
😎 @Raheemah2k26: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.