Skip to content

Report download failures, add more fields to report - #36

Merged
ofalvai merged 1 commit into
masterfrom
push-rrwsmlnznwmn
Aug 19, 2026
Merged

Report download failures, add more fields to report#36
ofalvai merged 1 commit into
masterfrom
push-rrwsmlnznwmn

Conversation

@ofalvai

@ofalvai ofalvai commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Why

report_status/download is only called after a successful download at the moment. It's important to track download failures as well, not just deployment failures.

What

Call report_status/download after failures, and introduce a status field.

Also add a few more useful fields to the report body that's easily available.

@ofalvai
ofalvai force-pushed the push-rrwsmlnznwmn branch from e99e7d0 to 07f7771 Compare August 18, 2026 17:10
Comment thread src/acquisition-sdk/acquisition-sdk.ts
@ofalvai
ofalvai force-pushed the push-rrwsmlnznwmn branch from 07f7771 to d500bca Compare August 19, 2026 09:18
@ofalvai ofalvai changed the title Report download status and duration Report download failures, add more fields to report Aug 19, 2026
@ofalvai
ofalvai requested a balanced review from Copilot August 19, 2026 09:23
console.log("Application downloading the package.");
res.download(exports.updatePackagePath);
});
app.post("/v0.1/public/codepush/report_status/download", function (req, res) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this handler so that the requests show up in test logs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds download outcome telemetry, including failures and additional package metrics.

Changes:

  • Adds download status types and report fields.
  • Reports successful and failed downloads with duration.
  • Updates SDK fixtures and the test server endpoint.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/acquisition-sdk/types.ts Extends download report types.
src/acquisition-sdk/acquisition-sdk.ts Builds enriched download reports.
src/acquisition-sdk/__tests__/acquisition-sdk.test.ts Supplies required status values.
package-mixins.js Reports download outcomes and duration.
code-push-plugin-testing-framework/script/serverUtil.js Accepts download status reports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package-mixins.js Outdated
const downloadStartTime = Date.now();
const reportDownloadStatus = async (status) => {
if (!reportStatusDownload) return;
const downloadDurationMs = Date.now() - downloadStartTime;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download_duration_ms gets sent on both outcomes, but it means two different things:

On success → how long a complete download took.
On failure → how long until it broke (which could be a fraction of a second if it failed instantly, or a long time if it timed out).

Both values land in the same download_duration_ms field. So if someone later charts "average download duration" without first filtering by status, they'd be averaging complete-download times together with time-to-failure — two unrelated things — and get a misleading number.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't intentional, thanks for catching it. I'll remove it from the failure case to avoid confusion, we can re-add this later if needed.

@ofalvai
ofalvai force-pushed the push-rrwsmlnznwmn branch from d500bca to 63eb0f2 Compare August 19, 2026 12:28
@ofalvai
ofalvai merged commit ad5bb01 into master Aug 19, 2026
5 checks passed
@ofalvai
ofalvai deleted the push-rrwsmlnznwmn branch August 19, 2026 12:49
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