Skip to content

Conversation

@gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Dec 16, 2025

Routes for the Map-Sharer:

  • POST /mapShares { mapId, receiverDeviceId }: create a map share, returns MapShare type. Data populated internally by the server (bounds, zoom, estimated size)
  • GET /mapShares: list all active map shares
  • GET /mapShares/:shareId: get MapShare info for a shareId
  • GET /mapShares/:shareId/events: state change events, including bytesDownloaded for state: 'downloading' events
  • GET /mapShares/:shareId/download: SMP file for share (accessed via P2P by receiver)
  • POST /mapShares/:shareId/cancel: cancel a map share

Routes for Map Receiver:

  • POST /mapShares/:shareId/decline { senderDeviceId, mapShareUrls, reason }: decline a map share (called on local server, which handles P2P request to sender)
  • POST /downloads { senderDeviceId, shareId, mapShareUrls, estimatedSizeBytes }: start downloading a map share. Returns { downloadId, ... }
  • GET /downloads: list all active downloads
  • GET /downloads/:downloadId: download state with current status
  • GET /downloads/:downloadId/events: state change events, including bytesDownloaded
  • POST /downloads/:downloadId/abort: abort download

On Map-sharer side, frontend:

  1. POST /mapShares to create the share
  2. Call mapeoProject.members.sendMapShare(mapShare)
  3. Listen on /mapShares/:shareId/events
  4. To cancel POST /mapShares/:shareId/cancel

On Map-sharer side, Core backend:

  1. project.members.sendMapShare(mapShare: MapShare) sends message as extension over project creator core

On Map-receiver side, frontend:

  1. Listen on mapeoProject.on('map-share')
  2. To accept: POST /downloads to start downloading
  3. To decline: POST /mapShares/:shareId/decline (local server handles P2P to sender)
  4. Listen on GET /downloads/:downloadId/events for progress
  5. To abort: POST /downloads/:downloadId/abort

On Map-receiver side, backend:

  1. Listen on project creator core for mapShare extension messages, then emit event map-share

The rest of the backend code is in the map server, e.g. in the map server on the receiver, POST /downloads will start a download from GET /mapShares/:shareId/download on the map-sharer, and stream events to any connections to GET /downloads/:downloadId/events

@gmaclennan gmaclennan self-assigned this Dec 16, 2025
* feat/maps-routes:
  fix: fix slow test teardown on node 18
  cache npm in CI
  test fixes
  add delay for concurrent uploads test
@gmaclennan gmaclennan mentioned this pull request Dec 16, 2025
@gmaclennan gmaclennan changed the base branch from feat/initial-implementation to feat/maps-routes January 21, 2026 13:45
@socket-security
Copy link

socket-security bot commented Jan 21, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpatch-package@​8.0.19710010082100
Updatedky@​1.14.0 ⏵ 1.7.5100 +110010090100

View full report

@gmaclennan gmaclennan marked this pull request as ready for review January 21, 2026 14:48
@gmaclennan gmaclennan changed the base branch from feat/maps-routes to main January 21, 2026 15:58
@gmaclennan
Copy link
Member Author

Tests hanging in node 18 for some reason. Will need to fix before merging.

@gmaclennan
Copy link
Member Author

Tests hanging in node 18 for some reason. Will need to fix before merging.

This was a test-specific issue related to the test usage of ky. Fixed in 2d8ea22 by pinning ky to v1.7.5. The issue was caused by a bug in ky v1.8.0+ related to ReadableStream.prototype.cancel() not completing when a Request is cloned and the cloned request body isn't consumed. This is a known Node.js 18 bug tracked in ky issue #690.

The ky library introduced memory leak mitigation code in v1.8.0 that immediately cancels a cloned request's body stream, but in Node 18 this causes the request to hang indefinitely.

ky is only used in tests as a convenience wrapper, not in the actual module code, so I think this fix is ok for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants