You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(workflow): a plain save writes is_public as NULL from the second autosave on (regression from #8125) #8496
Open any workflow and let it autosave twice. The first POST /api/workflow/persist succeeds; the second, and every one after it, returns 500. On the operator canvas the autosave subscription has no error handler, so this is silent: the user keeps editing and nothing after the first save is stored. The Form View shows "Could not save. Your latest changes are not stored yet." on every debounce. Expected: every save succeeds and leaves the publish flag alone.
Frontend: every caller feeds the persist response back into setWorkflowMetadata(...). That response is the stored row, whose flag is named isPublic, while the metadata type and GET /api/workflow/{wid} call it isPublished. After the first save isPublished is undefined, the next save posts isPublic: undefined, JSON drops the key, the pojo field is null, and the backend writes NULL into a NOT NULL column.
A stale isPublic: false on a save could likewise un-publish a published workflow, since publishing has its own endpoints (/public, /private) and a save should not touch the flag at all.
Fix: persistWorkflow writes name, description and content only; the frontend stops sending isPublic on a save and parseWorkflowInfo carries a persist response's isPublic over to isPublished so metadata fed back from a save keeps the publish state. Found while verifying #8455 (parent #8011).
How to reproduce?
Open any workflow on the canvas or in the Form View (flag on).
Make an edit, wait for the autosave (5 s). It succeeds.
Make another edit, wait again. POST /api/workflow/persist returns 500; on the canvas nothing is shown, on the Form View "Could not save" appears.
Or replay the request directly: POST /api/workflow/persist with {wid, name, description, content} and no isPublic key returns 500.
Version/Branch
1.4.0-incubating-SNAPSHOT (main)
Commit Hash (Optional)
b28faee (#8125) introduced the explicit is_public write; reproduced on 1fbd346.
What browsers are you seeing the problem on?
Chrome
Relevant log output
[ERROR] [io.dropwizard.jersey.errors.LoggingExceptionMapper] [dw-736 - POST /api/workflow/persist] - Error handling a request: a05806be43d8c174
org.jooq.exception.IntegrityConstraintViolationException: SQL [update "texera_db"."workflow"set"name"=?, "description"=?, "content"=?, "is_public"=? where "texera_db"."workflow"."wid"=?]; ERROR: null value in column "is_public" of relation "workflow" violates not-null constraint
at org.apache.texera.web.resource.dashboard.user.workflow.WorkflowResource.persistWorkflow(WorkflowResource.scala:463)
"POST /api/workflow/persist HTTP/1.1" 500
It looks like the issue description doesn't quite follow our template yet:
This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.
What happened?
Open any workflow and let it autosave twice. The first
POST /api/workflow/persistsucceeds; the second, and every one after it, returns 500. On the operator canvas the autosave subscription has no error handler, so this is silent: the user keeps editing and nothing after the first save is stored. The Form View shows "Could not save. Your latest changes are not stored yet." on every debounce. Expected: every save succeeds and leaves the publish flag alone.Root cause, two halves:
workflowDao.update(workflow)inpersistWorkflowwith an explicitUPDATE ... SET name, description, content, is_public = workflow.getIsPublic. The DAO update never wrote a nullisPublic; the explicit set does.setWorkflowMetadata(...). That response is the stored row, whose flag is namedisPublic, while the metadata type andGET /api/workflow/{wid}call itisPublished. After the first saveisPublishedis undefined, the next save postsisPublic: undefined, JSON drops the key, the pojo field is null, and the backend writes NULL into a NOT NULL column.A stale
isPublic: falseon a save could likewise un-publish a published workflow, since publishing has its own endpoints (/public,/private) and a save should not touch the flag at all.Fix:
persistWorkflowwrites name, description and content only; the frontend stops sendingisPublicon a save andparseWorkflowInfocarries a persist response'sisPublicover toisPublishedso metadata fed back from a save keeps the publish state. Found while verifying #8455 (parent #8011).How to reproduce?
POST /api/workflow/persistreturns 500; on the canvas nothing is shown, on the Form View "Could not save" appears.Or replay the request directly:
POST /api/workflow/persistwith{wid, name, description, content}and noisPublickey returns 500.Version/Branch
1.4.0-incubating-SNAPSHOT (main)
Commit Hash (Optional)
b28faee (#8125) introduced the explicit
is_publicwrite; reproduced on 1fbd346.What browsers are you seeing the problem on?
Chrome
Relevant log output