获取远程配置,并设置到sessionSampleRate - #18
Conversation
guguji5
commented
Aug 25, 2026
小程序里flashcatRum.init 内传入 remoteConfiguration: true,后,有获取config的请求发送。也输出了一下log。目前好像还没数据,等有数据了我会再验证一下
Duplicate each success notification step to post to a second DingTalk robot via the DING_TALK_TOKEN_2 / DING_TALK_SECRET_2 secrets. Failure notifications are unchanged and still go to the original robot only.
…-group ci: also send release success notifications to a second DingTalk group
The release workflow treated the DingTalk notification as a build gate: when the robot API rejects a message -- for example once its per-minute rate limit is exhausted -- the notification step failed and marked an otherwise successful publish as failed. Set `ignoreError` on every DingTalk step so a rejected notification is reported as a warning instead of failing the job. The publish outcome no longer depends on the notification channel.
The repository formats YAML with `singleQuote`, so the double-quoted value failed the format check.
…rror ci: do not fail a release when the DingTalk notification fails
The other four SDKs that carry this feature — web, iOS, Android and HarmonyOS — all spell the switch `remoteConfigurationEnabled`. A host writing the same integration twice should not have to remember that one platform spells it differently, and a boolean reads better with the suffix than as a bare noun. Renamed before any release, so no integration has to change. The JSDoc that came with it is translated, since everything git-facing here is English.
|
Reviewed this against the four other SDKs that carry the same feature (web, iOS, I pushed one commit (86a784b) rather than leave it as a comment, because it is a
Build and all 269 tests pass on the renamed branch. Three things still missing, compared with the other platformsThe commit message already says this slice only wires 1. getRemoteConfig: () => Record<string, unknown> | undefinedReference: browser-sdk — same language and the same architecture as this SDK. 2. Reference: browser-sdk, same file. 3. Copy the HarmonyOS contract here, not the web one. Web's callback also carries interface BeforeSamplingContext {
readonly sessionSampleRate: number // 0..100, console's where set, init's otherwise
readonly custom: Record<string, unknown> | null
}
type BeforeSamplingCallback = (context: BeforeSamplingContext) => number | undefinedTwo things the HarmonyOS implementation gets right and are worth copying exactly:
Reference: One small thingThe PR title is in Chinese. Everything git-facing in this repo — titles, bodies, |
Extend remote configuration beyond session sampling so hosts can drive their own decisions and force collection during support flows: - parse the top-level `custom` and cache it atomically with the sampling snapshot and ETag, exposed via `getRemoteConfig()` - add `setForcedSession()` to mark the next new Session as collected without touching the current one or changing sample rates - add the `beforeSampling` callback to adjust the rate of the Session being created, with safe fallback on invalid results and thrown errors Also export `BeforeSamplingContext` and `BeforeSamplingCallback` from the package entry, and fix the README still documenting the removed `remoteConfiguration` switch instead of `remoteConfigurationEnabled`.


