Skip to content

Log the SDK configuration at JS initialization - #75

Merged
ofalvai merged 1 commit into
push-swkztxomskuxfrom
push-xvqkwzuvuwvt
Oct 1, 2026
Merged

ofalvai merged 1 commit into
push-swkztxomskuxfrom
push-xvqkwzuvuwvt

Conversation

@ofalvai

@ofalvai ofalvai commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Logs from a device with a failing OTA update often lack the basics. They do not say which SDK version ran, which binary version ran, or whether the app ran the binary bundle or a CodePush update. This PR adds one info line with those facts. The SDK writes it the first time the JS layer reads the native configuration.

Example output:

Configuration: sdkVersion=… appVersion=1.2.0 deltaUpdates=true clientUniqueId=… binaryHash=… activePackage=fromCodePush activePackageLabel=v4 packageHash=…

Decisions

  • Logging never blocks or breaks getConfiguration. The log call is fire-and-forget and swallows its errors. getConfiguration returns as soon as native answers. If the running-package lookup fails, the line still appears and reports fromBinary.
  • The cache holds the promise, not the value. The log call is now part of the first fetch. sync starts the status report and the update check at nearly the same time. With a cached value, both calls miss the cache and fetch the configuration. They would also log it twice. With a cached promise, the second call reuses the first. A rejected promise clears the cache, so a failed call can retry. This matches the old behavior.
  • A debug-only package counts as the binary. In debug builds, native can return an old update that is still on disk while the binary bundle runs. Native marks that package with _isDebugOnly. Reporting it as fromCodePush would be wrong, so the log treats it as fromBinary.

@ofalvai
ofalvai added this pull request to stack #74 September 30, 2026 08:33
@ofalvai ofalvai changed the title push xvqkwzuvuwvt Logging: log the configuration once per JS runtime Sep 30, 2026
Copilot AI balanced review requested due to automatic review settings September 30, 2026 11:33
@ofalvai ofalvai changed the title Logging: log the configuration once per JS runtime Log the SDK configuration at JS initialization Sep 30, 2026

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.

Copilot review overview

🟡 Changes recommended

The new log exposes a persistent client identifier.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Caches configuration retrieval per JS runtime and adds one-time diagnostic logging.

Changes:

  • Caches concurrent configuration requests and retries after failure.
  • Logs SDK, app, binary, and active-package details.
File Description
CodePush.js Adds configuration caching and runtime diagnostics.

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

Comment thread CodePush.js Outdated
@ofalvai
ofalvai marked this pull request as ready for review September 30, 2026 11:39
@ofalvai
ofalvai force-pushed the push-xvqkwzuvuwvt branch from 0a1aadd to 3d8245f Compare October 1, 2026 07:29
@ofalvai
ofalvai force-pushed the push-xvqkwzuvuwvt branch from 3d8245f to d4fd913 Compare October 1, 2026 12:24
@ofalvai
ofalvai merged commit 3a52264 into master Oct 1, 2026
6 checks passed
@ofalvai
ofalvai deleted the push-xvqkwzuvuwvt branch October 1, 2026 15:05
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