kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Handle network locations that share an instance_id

Open rtibbles opened this issue 2 weeks ago โ€ข 5 comments

๐Ÿ™‚ 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>/ and POST /api/discovery/networklocation/<instance_id>/update_connection_status/ raise MultipleObjectsReturned (learner). network_location.py#L139-L142.

The Change

  • A lookup by instance_id should 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.

rtibbles avatar Nov 15 '26 20:11 rtibbles

Hi! ๐Ÿ‘‹

This issue is available for contribution and supports self-assignment. Here's how to get started:

  • Comment /assign to 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.

learning-equality-bot avatar Nov 15 '26 21:11 learning-equality-bot

/assign

Iโ€™ve read the contributing guidelines, including the section on using generative AI.

SurbhiD404 avatar Nov 16 '26 04:11 SurbhiD404

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.

learning-equality-bot avatar Nov 16 '26 04:11 learning-equality-bot

/assign @SurbhiD404 I would like to work on this issue

ArpitaSamanta10 avatar Nov 16 '26 04:11 ArpitaSamanta10

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.

learning-equality-bot avatar Nov 16 '26 04:11 learning-equality-bot