[PR #1119] [MERGED] fix: ssr feature flags #1402

Closed
opened 2026-02-26 19:33:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1119
Author: @dguyen
Created: 4/26/2024
Status: Merged
Merged: 4/26/2024
Merged by: @dguyen

Base: mainHead: fix/ssr-feature-flags


📝 Commits (2)

📊 Changes

1 file changed (+15 additions, -6 deletions)

View changed files

📝 packages/lib/universal/get-feature-flag.ts (+15 -6)

📄 Description

Description

Feature flags are broken on SSR due to this error

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11731:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: RequestContentLengthMismatchError: Request body length does not match content-length header
      at write (node:internal/deps/undici/undici:8590:41)
      at _resume (node:internal/deps/undici/undici:8563:33)
      at resume (node:internal/deps/undici/undici:8459:7)
      at [dispatch] (node:internal/deps/undici/undici:7704:11)
      at Client.Intercept (node:internal/deps/undici/undici:7377:20)
      at Client.dispatch (node:internal/deps/undici/undici:6023:44)
      at [dispatch] (node:internal/deps/undici/undici:6254:32)
      at Pool.dispatch (node:internal/deps/undici/undici:6023:44)
      at [dispatch] (node:internal/deps/undici/undici:9343:27)
      at Agent.Intercept (node:internal/deps/undici/undici:7377:20) {
    code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  }
}

I've removed content-length header since it isn't mandatory to my knowledge for get requests.

Changes

  • Add fallback local flags when individual flag request fails
  • Add error logging
  • Remove content-length from headers being passed to Posthog

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1119 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 4/26/2024 **Status:** ✅ Merged **Merged:** 4/26/2024 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `fix/ssr-feature-flags` --- ### 📝 Commits (2) - [`56167fc`](https://github.com/documenso/documenso/commit/56167fc6e8bb513b79c3df9187a0f6d70c5762b0) fix: ssr feature flags - [`f2340ee`](https://github.com/documenso/documenso/commit/f2340eebc5e73a011425a235c193957abbc58900) fix: add flag fallback ### 📊 Changes **1 file changed** (+15 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/lib/universal/get-feature-flag.ts` (+15 -6) </details> ### 📄 Description ## Description Feature flags are broken on SSR due to this error ``` TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11731:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: RequestContentLengthMismatchError: Request body length does not match content-length header at write (node:internal/deps/undici/undici:8590:41) at _resume (node:internal/deps/undici/undici:8563:33) at resume (node:internal/deps/undici/undici:8459:7) at [dispatch] (node:internal/deps/undici/undici:7704:11) at Client.Intercept (node:internal/deps/undici/undici:7377:20) at Client.dispatch (node:internal/deps/undici/undici:6023:44) at [dispatch] (node:internal/deps/undici/undici:6254:32) at Pool.dispatch (node:internal/deps/undici/undici:6023:44) at [dispatch] (node:internal/deps/undici/undici:9343:27) at Agent.Intercept (node:internal/deps/undici/undici:7377:20) { code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' } } ``` I've removed content-length header since it isn't mandatory to my knowledge for get requests. ## Changes - Add fallback local flags when individual flag request fails - Add error logging - Remove `content-length` from headers being passed to Posthog --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1402
No description provided.