Handle network locations that share an instance_id
๐ Looking for an issue? Welcome! This issue is open for contribution. If this is the first time youโre requesting an issue, please:
- Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that donโt follow the guidelines wonโt be answered.
- Confirm that youโve read the guidelines in your comment.
Overview
The network location API lets clients look a location up by its peer's instance_id, and assumes only one location has it. The same peer added by IP address and by hostname, or added manually and also discovered, gives two. Looking it up by instance_id then returns a 500.
Complexity: Low Target branch: develop
Context
- On develop at fe298f5449, with two network locations sharing an
instance_id,GET /api/discovery/networklocation/<instance_id>/andPOST /api/discovery/networklocation/<instance_id>/update_connection_status/raiseMultipleObjectsReturned(learner).network_location.py#L139-L142.
The Change
- A lookup by
instance_idshould pick one location deterministically when several match.
Acceptance Criteria
- [ ] Both requests under Context return 200.
- [ ] The location returned is the same on repeated requests.
- [ ] Tests cover both requests with two locations sharing an
instance_id.
AI usage
I had Claude Code sweep Kolibri for crashes and wrong results caused by data that sync, soft deletion or concurrent writes can create, and reproduce each one. I chose the grouping. Claude Code drafted the issue.
Hi! ๐
This issue is available for contribution and supports self-assignment. Here's how to get started:
- Comment
/assignto assign yourself to this issue - You can have up to 2 issues assigned at a time across all community repos
- Dropping an issue has a 7-day cooldown before the slot opens up
- Link your pull request to this issue when you submit it
๐ Read the Contributing guidelines before starting.
Are you preparing for Google Summer of Code? See our GSoC guidelines.
/assign
Iโve read the contributing guidelines, including the section on using generative AI.
Hi! ๐
You can't be assigned to this issue right now because you've reached the 2-issue limit.
Your current assignments:
- https://github.com/learningequality/kolibri/issues/15869
- https://github.com/learningequality/kolibri/issues/15550
Once a slot opens up, come back and comment /assign again. ๐
Are you preparing for Google Summer of Code? See our GSoC guidelines.
/assign @SurbhiD404 I would like to work on this issue
Hi! ๐
You've been assigned to this issue. Here's what to do next:
- Read the issue description carefully and make sure you understand the requirements
- Link your pull request to this issue when you submit it
- If you can no longer work on this, unassign yourself so others can pick it up
Good luck! ๐
Are you preparing for Google Summer of Code? See our GSoC guidelines.