Source
Follow-up from review of merged PR #340 (fix: refresh empty change-object actions).
Problem
PR #340 fixed the empty case (`change $Obj;` re-binds `RefreshInClient=true` so Studio Pro accepts the action). The symmetrical case is still broken: a non-empty `ChangeObjectAction` with `RefreshInClient=true` in the original Studio Pro model loses its refresh flag on `describe → exec`. The describer emits `change $Obj (attr = val);` and the builder always sets `RefreshInClient=false` for non-empty changes. Re-execute then writes a different MPR.
Expected behavior
The MDL grammar should accept a `refresh` modifier on `change`, matching the existing pattern for `commit` (`commit $Obj [with events] [refresh];`) and `rollback` (`rollback $Obj refresh;`):
```mdl
change $Obj (attr = value) refresh;
change $Obj refresh; -- equivalent to today's empty change
```
The describer should emit `refresh` whenever `ChangeObjectAction.RefreshInClient` is true, regardless of whether `Items` is empty or non-empty. The builder should map the modifier into the BSON field.
Proposed fix
- Grammar: add optional `REFRESH` token to `changeObjectStatement`.
- AST: add `Refresh bool` to `ChangeObjectStmt`.
- Visitor: populate the field.
- Builder: replace the inferred `len(s.Changes) == 0` with `s.Refresh || len(s.Changes) == 0` (keep the empty-case inference for backwards compatibility).
- Formatter: emit `refresh` suffix when `a.RefreshInClient` is true.
- Doctype + bug-test for both `change … refresh` and `change … (…) refresh`.
Related
Source
Follow-up from review of merged PR #340 (fix: refresh empty change-object actions).
Problem
PR #340 fixed the empty case (`change $Obj;` re-binds `RefreshInClient=true` so Studio Pro accepts the action). The symmetrical case is still broken: a non-empty `ChangeObjectAction` with `RefreshInClient=true` in the original Studio Pro model loses its refresh flag on `describe → exec`. The describer emits `change $Obj (attr = val);` and the builder always sets `RefreshInClient=false` for non-empty changes. Re-execute then writes a different MPR.
Expected behavior
The MDL grammar should accept a `refresh` modifier on `change`, matching the existing pattern for `commit` (`commit $Obj [with events] [refresh];`) and `rollback` (`rollback $Obj refresh;`):
```mdl
change $Obj (attr = value) refresh;
change $Obj refresh; -- equivalent to today's empty change
```
The describer should emit `refresh` whenever `ChangeObjectAction.RefreshInClient` is true, regardless of whether `Items` is empty or non-empty. The builder should map the modifier into the BSON field.
Proposed fix
Related