Closed Bug 1141866 Opened 5 years ago Closed 5 years ago

[P2P Sharing] Request peer app lists only when a peer is discovered or an update notice is received

Categories

(Firefox OS Graveyard :: Gaia::P2P Sharing, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: drs, Assigned: drs)

References

Details

(Whiteboard: [spark])

Attachments

(1 file)

We're currently querying all known peers every 5 seconds for their app list. This is very slow, cumbersome, and expensive. Instead, we should request a peer's app list under the following circumstances:
1. On discovery.
2. Open up the local HTTPServer to receive notifications that a peer's app list has been updated.
3. Every 5 minutes or so, to prevent the peer list from going stale.
Status: NEW → ASSIGNED
This is taking a bit longer than expected as I decided to basically rewrite the backend from scratch as part of this bug.
There are some known regressions to toggling sharing, but I will deal with these in another bug.
Attachment #8576943 - Flags: review?(jdarcangelo)
Comment on attachment 8576943 [details] [review]
Request peer app lists only when a peer is discovered or an update notice is received.

Conditional R+. Please address my comment regarding the `setInterval` for `DNSSD.startDiscovery` in your follow-up bug 1142766. Otherwise, looks good!
Attachment #8576943 - Flags: review?(jdarcangelo) → review+
(In reply to Justin D'Arcangelo [:justindarc] from comment #3)
> Comment on attachment 8576943 [details] [review]
> Request peer app lists only when a peer is discovered or an update notice is
> received.
> 
> Conditional R+. Please address my comment regarding the `setInterval` for
> `DNSSD.startDiscovery` in your follow-up bug 1142766. Otherwise, looks good!

I just went back to the dns-sd.js source and actually there's probably no harm in calling this on an interval. Although, it probably shouldn't be needed, it can't hurt.
https://github.com/fxos/sharing/commit/0c6b8709e6bd9e34b1df5b41050abc05409c453c

Will deal with comments in bug 1142766.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Whiteboard: [lightsaber] → [ignite]
Whiteboard: [ignite] → [spark]
Component: Gaia → Gaia::P2P Sharing
You need to log in before you can comment on or make changes to this bug.