Closed bryan-robitaille closed 3 months ago
https://qzbs4iw3ljwxrqzxqh5frtsdkq0ousnl.lambda-url.ca-central-1.on.aws/
Not sure if it is related to your work but I am getting the following error sometimes when browsing through the different pages (still testing locally).
⨯ Internal error: TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is already closed at ReadableByteStreamController.enqueue (node:internal/webstreams/readablestream:1175:13) at eV (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:211091) at eJ (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:210389) at Timeout._onTimeout (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:200146) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7)
Not sure if it is related to your work but I am getting the following error sometimes when browsing through the different pages (still testing locally).
⨯ Internal error: TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is already closed at ReadableByteStreamController.enqueue (node:internal/webstreams/readablestream:1175:13) at eV (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:211091) at eJ (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:210389) at Timeout._onTimeout (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:200146) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7)
@craigzour Are you still seeing this error? I can't reproduce it
Not sure if it is related to your work but I am getting the following error sometimes when browsing through the different pages (still testing locally).
⨯ Internal error: TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is already closed at ReadableByteStreamController.enqueue (node:internal/webstreams/readablestream:1175:13) at eV (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:211091) at eJ (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:210389) at Timeout._onTimeout (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:200146) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7)
@craigzour Are you still seeing this error? I can't reproduce it
I talked to Bryan about it and it is not related to his work but NextJS hot reload feature which should not be happening in a production build.
Not sure if it is related to your work but I am getting the following error sometimes when browsing through the different pages (still testing locally).
⨯ Internal error: TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is already closed at ReadableByteStreamController.enqueue (node:internal/webstreams/readablestream:1175:13) at eV (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:211091) at eJ (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:210389) at Timeout._onTimeout (/Users/clementjanin/github/platform-forms-client/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:200146) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7)
@craigzour Are you still seeing this error? I can't reproduce it
I talked to Bryan about it and it is not related to his work but NextJS hot reload feature which should not be happening in a production build.
How weird. How could a hot reload even happen in a prod build :)
From my end everything looks good
Summary | Résumé
fixes: #3855
React Component Refactors:
Removes the direct call to get the Template information from the database and instead uses the TemplateStore as the source of truth under the
form-builder
path.As a stop gap to a larger refactor a
<ClientContainer />
component was created to move the server side logic to the client side where possible.The
/form-builder/responses
path was tricky and will need to be refactored / optimized in the future as many of the components were rendering up to 4 times per load.Function Refators:
The
getAllTemplates()
function is now a function that requiresManageAllForms
privilegeThe
getAllTemplateForUser()
function has been modified to return all the templates for the calling abilities userId. It also accepts arequestedWhere
option that allows fine grain control of the selection criteria.The
Test instructions | Instructions pour tester la modification
Setup -
/form-builder
with draft form/form-builder/{id}/published
route. Should be redirected to/publish
/form-builder/{id}/publish
route. Should be redirected to/published
utils
Unresolved questions / Out of scope | Questions non résolues ou hors sujet
There is a larger refactor needed to optimize the amount of renderings. Many high level components are rendering multiple times per load causing all child components to render multiple times as well. This behavior was noticed in
/form-builder/responses
but could also be occurring elsewhere.Pull Request Checklist
Please complete the following items in the checklist before you request a review: