mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-16 06:08:33 -05:00
[PR #3069] [CLOSED] Return error response for stale hole-punch rejection #25769
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/3069
Author: @rinseaid
Created: 5/14/2026
Status: ❌ Closed
Base:
dev← Head:fix/stale-holepunch-error-response-v2📝 Commits (1)
8c7ac9cReturn error response for stale hole-punch rejection during Olm registration📊 Changes
2 files changed (+6 additions, -1 deletions)
View changed files
📝
server/routers/olm/error.ts(+5 -0)📝
server/routers/olm/handleOlmRegisterMessage.ts(+1 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Preface
This PR was developed with Claude Code (claude-opus-4-6). I identified the bug through live debugging of a broken Olm tunnel after a Pangolin server restart, traced the root cause through the code, and directed the fix. Claude wrote the patch. I reviewed and validated all changes.
Description
When
handleOlmRegisterMessagerejects a registration becauselastHolePunchis stale (more than 5 seconds old and the client has sites to receive), it performs a barereturnwith no response to the client. The client has no way to know its registration was rejected or why, so it retries blindly until it exhausts its retry budget (20 attempts at 2-second intervals), then gives up silently.This is particularly problematic during server restarts: the server's in-memory
lastHolePunchtimestamps reset, so the first registration attempt after reconnect is always rejected. Combined with the Olm re-registration bug (fosrl/olm#123), this creates a double failure where the client either never re-registers or re-registers into a silent rejection loop.Fix: Send an
olm/errorresponse with a newSTALE_HOLE_PUNCHerror code before returning. This uses the existingsendOlmErrorpattern that other rejection paths in the same function already use. The Olm client'shandleOlmErrorhandler will log the error and surface it via the API server status endpoint, giving users visibility into the failure.Related issues: #2951, #2901, #2318, #2343, #3041, #1526
Companion PR: fosrl/olm#123
How to test?
STALE_HOLE_PUNCHerror and logs it. The error is visible in the Olm status API.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.