mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
## What changed? Ignore unknown fields when decoding Worker Deployment memo for backwards compatibility ## Why? New field was added to memo. We want to be able to roll back server and still list deployments, just without that field ## How did you test it? Tested it with v148. Also cherry-picked onto v147.6 and ran my unit test. With the new Lenient converter, the unit test passed as expected. With the old strict converter, the unit test failed as expected. - [x] built - [ ] run locally and tested manually - [x] covered by existing tests - [x] added new unit test(s) - [ ] added new functional test(s) ## Potential risks Changing the data converter is risky, but in this case, we know we are decoding a proto, and we have tests covering that decoding, so I think it's ok --- > [!NOTE] > Makes JSON/protobuf memo decoding lenient to support backward compatibility and adds tests to verify decoding behavior. > > - Update `PreferProtoDataConverter` to use `NewProtoJSONPayloadConverterWithOptions(AllowUnknownFields: true)`, causing proto JSON decoding to ignore unknown fields > - Add `TestDecodeWorkerDeploymentMemoTolerateUnknownFields` and `TestDecodeWorkerDeploymentMemoTolerateMissingFields` with memo JSON fixtures to validate `DecodeWorkerDeploymentMemo` succeeds and parses known fields > > <sup>Written by [Cursor Bugbot]() for commit a0d1ea46134d13fd21aaf81da7e97400748fd01a. This will update automatically on new commits. Configure [here]().</sup>