Repository navigation
Description
What happened?
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.
Root cause, two halves:
- Backend: feat(workflow): persist is_form_view and add Form View toggle endpoints #8125 replaced
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. - Frontend: every caller feeds the persist response back into
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: 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/persistreturns 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
Activity
github-actions commentedon Sep 11, 2026
👋 Thanks for opening this issue, @yangzhang75!
It looks like the issue description doesn't quite follow our template yet:
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.
yangzhang75 commentedon Sep 11, 2026
/take
fix(workflow): a plain save no longer clobbers is_public (apache#8498)