Repository navigation
feat: collect public link events - #5174
Open
doubleface wants to merge 4 commits into
Open
doubleface wants to merge 4 commits into
doubleface wants to merge 4 commits into
Conversation
The VFS, Stack's file storage layer, builds ZIP downloads while streaming their contents. The final ZIP directory is written only when the archive writer closes, but its error was previously ignored. Propagate that failure and reject source files whose copied length differs from their metadata, so a partial archive cannot be mistaken for a successful download by the activity collector.
Stack prepares a download URL in one request and serves the bytes in a later request using a temporary secret. That later request no longer identifies the public link that authorized the download. Keep its permission and root identifiers beside the existing secret in memory or Redis, so completion can be attributed to the right link without changing access checks, exposing sharecodes or breaking older secrets.
Stack serves public pages and downloads through different handlers, and its subdomain router wraps the API response in another Echo response. Collect at successful action boundaries, not URL preparation or asset requests. Unwrap only Echo's delegating responses to reach a transport flush that reports errors; do not bypass unknown buffered flushers. This establishes completed server writes, never client receipt. Keep events on the link owner's instance and never infer identity from an IP or sharecode.
Shared-drive recipients forward public download secrets with their own share-interact token. Its actor identifies the transport, not the visitor, even when the caller sent no credentials. Exclude that actor from public-secret download events while preserving verified owner tokens and sessions, and the actors of authenticated link creation and modification.
shepilov
reviewed
Nov 4, 2026
|
|
||
| zw := zip.NewWriter(w) | ||
| defer zw.Close() | ||
| defer func() { |
Member
There was a problem hiding this comment.
does it affects the http response for the client?
shepilov
reviewed
Nov 4, 2026
| if entry.Page <= 0 { | ||
| _, err = io.Copy(ze, f) | ||
| n, err := io.Copy(ze, f) | ||
| if err == nil && n != file.ByteSize { |
Member
There was a problem hiding this comment.
mmm, in this case we will have half of an archive and an error
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary