Skip to content

Reject object updates containing unknown fields - #1174

Merged
Haven Xia (HavenXia) merged 1 commit into
agent-substrate:mainfrom
laoj2:update-full-objects
Aug 25, 2026
Merged

Haven Xia (HavenXia) merged 1 commit into
agent-substrate:mainfrom
laoj2:update-full-objects

Conversation

@laoj2

Copy link
Copy Markdown
Collaborator

#1011

An update containing unknown fields during a RMW indicates there's a version skew between client and server.

So, the server enforces a policy to fail explicitly when it receives an unknown proto field: so that it does not silently drop fields that the user intended to set but the current server version cannot process

This also helps to avoid behaviour drift during rolling upgrades: During rolling upgrades, different components (like the data plane and control plane) can be on different versions. If an older server replica . If an older server replica processes a request coming from a newer client, it will reject it (it doesn't know how to validate/handle it) and it's the client's responsibility to retry.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

@HavenXia

Copy link
Copy Markdown
Member

Thanks, this matches exactly the 2nd proposal in substrate upgrade proposal

Haven Xia (HavenXia) added a commit to HavenXia/substrate that referenced this pull request Aug 25, 2026
A Create carrying unknown fields means the caller knows a newer schema
than this server and is asking for behavior it cannot deliver. Dropping
them silently creates the resource without what the user thinks they
set. Reject with InvalidArgument instead, completing the create half of
the reject-on-write rule from agent-substrate#954; the update half is agent-substrate#1174, whose
validateNoUnknownFields helper this reuses.

Covers CreateActor, CreateActorTemplate, CreateAtespace and
CreateActorSnapshotTag.
@HavenXia Haven Xia (HavenXia) mentioned this pull request Aug 25, 2026
2 tasks done
Haven Xia (HavenXia) added a commit to HavenXia/substrate that referenced this pull request Aug 25, 2026
A Create carrying unknown fields means the caller knows a newer schema
than this server and is asking for behavior it cannot deliver. Dropping
them silently creates the resource without what the user thinks they
set. Reject with InvalidArgument instead, completing the create half of
the reject-on-write rule from agent-substrate#954; the update half is agent-substrate#1174, whose
validateNoUnknownFields helper this reuses.

Covers CreateActor, CreateActorTemplate, CreateAtespace and
CreateActorSnapshotTag.
@HavenXia
Haven Xia (HavenXia) merged commit 790ee35 into agent-substrate:main Aug 25, 2026
9 checks passed
Haven Xia (HavenXia) added a commit to HavenXia/substrate that referenced this pull request Aug 25, 2026
A Create carrying unknown fields means the caller knows a newer schema
than this server and is asking for behavior it cannot deliver. Dropping
them silently creates the resource without what the user thinks they
set. Reject with InvalidArgument instead, completing the create half of
the reject-on-write rule from agent-substrate#954; the update half is agent-substrate#1174, whose
validateNoUnknownFields helper this reuses.

Covers CreateActor, CreateActorTemplate, CreateAtespace and
CreateActorSnapshotTag.
@laoj2
Luiz Oliveira (laoj2) deleted the update-full-objects branch August 25, 2026 15:36
Benjamin Elder (BenTheElder) added a commit to BenTheElder/substrate that referenced this pull request Aug 25, 2026
agent-substrate#1174 landed a test written against tag, which agent-substrate#1167 had renamed to
actor_snapshot_tag, so cmd/ateapi/internal/controlapi does not compile.
Luiz Oliveira (laoj2) pushed a commit that referenced this pull request Aug 25, 2026
Part of #1011 , stack on #1174 

As I was writing [ate upgrade
proposal](https://docs.google.com/document/d/1JduAyGZFyqdNp4UhKiv0EN-is3iW5tf5BwGTWbt2ouI/edit?usp=sharing&resourcekey=0-MXG12QCkleIxhY7cOB7g6A),
we should have both rejection for unknown fields for creating and
updating. Add the creating part here.

- [x] Tests pass
- [x] Appropriate changes to documentation are included in the PR
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.

2 participants