Repository navigation
fix(backend): keep the backend image id when only image_url is unusable - #111
Merged
Merged
Conversation
- a 2xx reply with a valid image_id and a bad or missing image_url returned no id, so the sink fell back to the local capture id - the id is now kept when it passes validation on its own; only the URL is dropped Signed-off-by: Simon van Lierde <simonvanlierde@gmail.com>
- the constant is imported by another module, so it is not private Signed-off-by: Simon van Lierde <simonvanlierde@gmail.com>
Merging this PR will not alter performance1 warning
Comparing Footnotes |
simonvanlierde
enabled auto-merge (squash)
October 27, 2026 16:00
simonvanlierde
disabled auto-merge
October 27, 2026 16:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This keeps the backend's real image id when its upload reply has a valid
image_idbut a bad or missingimage_url. Before, the whole reply was dropped and the sink fell back to the Pi's local capture id.upload_imagereturnedUploadedImageInfo(image_id=None, image_url=None)for any invalid reply, soBackendPushSink.putused the local id.DeviceImageUploadAck: if none are onimage_id, the id is kept and only the URL is dropped. An invalid id is still dropped._API_PORTtoAPI_PORTinapp/pairing/routers, since another module imports it. No behaviour change.Tests:
just checkpasses (918 passed, 1 skipped). The new test for a valid id with a bad URL failed before the fix withassert None == 'server-abc'. Not tried against a real backend.