Skip to content

Improve expectPubId mismatch error message#2678

Merged
jwhartley merged 2 commits intomasterfrom
improve-expect-pub-id-error-message
Mar 17, 2026
Merged

Improve expectPubId mismatch error message#2678
jwhartley merged 2 commits intomasterfrom
improve-expect-pub-id-error-message

Conversation

@jwhartley
Copy link
Copy Markdown
Contributor

Summary

  • Rewrites the ExpectPubIdNotMatched error to be more human-readable: leads with what happened, gives a clear action, and demotes publication IDs to a parenthetical
  • Motivated by customer confusion — the current message is truncated in the UI and the hex IDs are not actionable

Before:

expected publication ID 0000000000000000 was not matched (it's actually 117efc2f6100029f):
your changes have already been published or another publication has modified this spec;
please try again with a fresh copy of the spec.

After:

This task was updated while you were editing — please refresh the spec and re-apply your changes.
This may have been an automated system update. (expected publication ID 0000000000000000, actual 117efc2f6100029f)

Context

This error commonly occurs when automated system updates (e.g. inferred schema changes, auto-discovers, controller convergence) modify a spec while a user is editing it. The old message was written for developers and doesn't help customers understand what to do.

Question: Do inferred schema changes still update last_pub_id? The Aug 2024 plan (#1520) outlined separating last_pub_id from last_build_id so that dependency-only changes wouldn't bump last_pub_id. If that's been implemented, this error should be less frequent — but when it does occur, it should still be clear.

Test plan

  • cargo test -p validation -- test_insert_but_already_exists test_update_but_does_not_exist passes locally
  • Integration test in locking_retries.rs updated to match
  • CI passes

🤖 Generated with Claude Code

Before:
  expected publication ID 0000000000000000 was not matched (it's
  actually 117efc2f6100029f): your changes have already been published
  or another publication has modified this spec; please try again with
  a fresh copy of the spec.

After:
  This task was updated while you were editing — please refresh the
  spec and re-apply your changes.
  This may have been an automated system update. (expected publication
  ID 0000000000000000, actual 117efc2f6100029f)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jwhartley jwhartley requested a review from psFried February 16, 2026 04:51
Copy link
Copy Markdown
Contributor

@psFried psFried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this, though I might suggest changing "task" to "spec" or something. But this has come up before and I remember @jgraettinger having stronger opinions about it, so I'll let him decide.

@psFried psFried requested a review from jgraettinger February 17, 2026 12:30
@psFried
Copy link
Copy Markdown
Contributor

psFried commented Feb 17, 2026

Do inferred schema changes still update last_pub_id?

They do update the last_pub_id of the Collection, but they don't generally require updating it on connected tasks. In other words, the collection itself is actually changed by the inferred schema update, but the tasks just see it as a change in dependencies.

},
#[error(
"expected publication ID {expect_id} was not matched (it's actually {actual_id}): your changes have already been published or another publication has modified this spec; please try again with a fresh copy of the spec."
"This task was updated while you were editing — please refresh the spec and re-apply your changes.\nThis may have been an automated system update. (expected publication ID {expect_id}, actual {actual_id})"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "spec" or "specification", as this error applies to collection as well (which are usually not tasks).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Per review feedback — this error applies to collections too, not just tasks.
@jwhartley jwhartley requested a review from jgraettinger March 11, 2026 11:12
Copy link
Copy Markdown
Member

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jwhartley jwhartley merged commit b7e3762 into master Mar 17, 2026
11 checks passed
@jwhartley jwhartley deleted the improve-expect-pub-id-error-message branch March 17, 2026 10:48
github-actions bot pushed a commit to estuary/homebrew-flowctl that referenced this pull request Mar 25, 2026
This release includes support for the upcoming materialization triggers feature, in addition to several other bugfixes and improvements.

## What's Changed
- Fix double-slash in journal list selector breaking collection reads by @jgraettinger in estuary/flow#2718
- Include flowctl version in publication details by @psFried in estuary/flow#2748
- Improve error message for concurrent spec modifications by @jwhartley in estuary/flow#2678
- Add support for materialization triggers by @williamhbaker in estuary/flow#2800
williamhbaker added a commit to estuary/homebrew-flowctl that referenced this pull request Mar 25, 2026
This release includes support for the upcoming materialization triggers feature, in addition to several other bugfixes and improvements.

## What's Changed
- Fix double-slash in journal list selector breaking collection reads by @jgraettinger in estuary/flow#2718
- Include flowctl version in publication details by @psFried in estuary/flow#2748
- Improve error message for concurrent spec modifications by @jwhartley in estuary/flow#2678
- Add support for materialization triggers by @williamhbaker in estuary/flow#2800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants