Skip to content

[VSDK-770] - Identify Flutter Commons signaling - #49

Merged
g-telnyx merged 7 commits into
mainfrom
feat/vsdk-770-mobile-sdk-identity
Oct 20, 2026
Merged

g-telnyx merged 7 commits into
mainfrom
feat/vsdk-770-mobile-sdk-identity

Conversation

@g-telnyx

@g-telnyx g-telnyx commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Pass webrtc-flutter-commons and package version 0.2.0 through credential and token configs.
  • Preserve Commons identity for stored-config and push/reconnect paths.
  • Temporarily consume the corrected Flutter core identity implementation from PR #350.

Verification

  • 4 focused identity tests passed.
  • dart format passed on changed Dart files.
  • git diff --check passed.

Dependency

Blocked on Flutter core PR #350 and a subsequent hosted telnyx_webrtc release containing that fix. Before merging this PR, replace the temporary Git dependency with the compatible hosted package version and re-run validation.

No release is included.

@g-telnyx
g-telnyx marked this pull request as ready for review October 13, 2026 10:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T10:27:26.659985Z 7877bc1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16aaf5955f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread pubspec.yaml Outdated
Comment thread lib/src/internal/session/session_manager.dart
Comment thread lib/src/internal/sdk_identity.dart
P1 #2 (session_manager.dart): persist the decorated telnyxConfig (with
Commons SDK identity) for later push reconnections instead of the
caller-supplied undecorated config. Previously, after a direct credential
or token login, connectWithPushMetadata() reconnected with the
undecorated config and lost mobileSdkName/mobileSdkVersion on the wire.

P1 #3 (sdk_identity.dart / config_helper.dart / release.sh / tests):
remove the hard-coded '0.2.0' literal scattered across the package and
source commonsSdkVersion from one release-controlled location.

- sdk_identity.dart is now the single source of truth for both
  commonsSdkName and commonsSdkVersion, with file-level dartdoc
  describing the contract.
- config_helper.dart imports commonsSdkName / commonsSdkVersion instead
  of repeating the literals.
- scripts/release/release.sh bump now updates both pubspec.yaml and
  sdk_identity.dart in a single edit, so the next release identifies
  itself correctly on the wire.
- A new commonsSdkVersionPubspecSync drift-guard test reads pubspec.yaml
  from disk and fails the suite if commonsSdkVersion diverges from
  pubspec.yaml version. Verified end-to-end: bump 0.3.0 updates both
  files and the test passes; manually setting commonsSdkVersion to
  0.9.9 fails the test with a clear actionable message.

P1 #1 (restore hosted telnyx_webrtc dependency in pubspec.yaml) remains
blocked on the upstream VSDK-769 / telnyx_webrtc release that exposes
Config.mobile_sdk_name on pub.dev. Will be addressed in a follow-up
once the upstream release ships; pubspec.yaml still points at the
vsdk-769-sdk-identity-override Git ref for now.

flutter analyze: no new issues introduced.
flutter test: 20/20 passing (3 existing identity tests + drift-guard).
@mobile-sdk-afk

Copy link
Copy Markdown

[afk-bot] Addressed P1 review items #2 and #3 from Codex (2026-10-13T10:09:42Z) in new commit 0f3b70b70410b7a88498f2617d0b07796f29852.

P1 #2 — Store decorated config for push connections (FIXED)

lib/src/internal/session/session_manager.dart:

  • connectWithCredential() and connectWithToken() now persist telnyxConfig (the decorated config carrying mobileSdkName: flutter_commons + mobileSdkVersion) instead of the undecorated caller-supplied config.
  • Result: a subsequent connectWithPushMetadata() reconnect during the same client session now carries the Commons SDK identity on the wire, matching the initial login.

P1 #3 — Derive signaled version from package release (FIXED)

lib/src/internal/sdk_identity.dart + lib/src/utils/config_helper.dart + scripts/release/release.sh + test/mobile_sdk_identity_test.dart:

  • sdk_identity.dart is now the single source of truth for commonsSdkName and commonsSdkVersion, with file-level dartdoc describing the contract.
  • config_helper.dart imports commonsSdkName / commonsSdkVersion instead of repeating the 'flutter_commons' and '0.2.0' literals.
  • scripts/release/release.sh bump <version> now updates both pubspec.yaml AND the commonsSdkVersion constant in sdk_identity.dart in a single edit, so the next release identifies itself correctly on the wire (verified end-to-end with bump 0.3.0).
  • A new commonsSdkVersionPubspecSync drift-guard test reads pubspec.yaml from disk and fails the suite if commonsSdkVersion diverges from the version: field. Verified:
    • Match (0.2.0 vs 0.2.0): test passes.
    • Mismatch (manually set 0.9.9 vs 0.2.0): test fails with commonsSdkVersion (=0.9.9) must equal pubspec.yaml version (=0.2.0). Re-run scripts/release/release.sh bump <version> to update both.

P1 #1 — Restore hosted telnyx_webrtc dependency (still blocked)

pubspec.yaml still pins telnyx_webrtc to the vsdk-769-sdk-identity-override Git ref because no pub.dev release of telnyx_webrtc exposes Config.mobile_sdk_name / mobile_sdk_version yet (pub.dev latest is still 4.5.0, published 2026-10-12T11:25:31Z; VSDK-769 / PR #348 in team-telnyx/flutter-voice-sdk still state: open / merged: false).

P1 #1 will be addressed in a follow-up commit once telnyx_webrtc ships a release with the identity fields — at that point we drop the Git ref, bump ^4.2.0 to the new minimum, re-run flutter test, and the PR should merge cleanly.

Validation

  • flutter analyze: 30 pre-existing issues (example/, Firebase options not committed, pubspec git-dep warning from the existing PR), no new issues from this commit.
  • flutter test: 20/20 passing (3 existing identity tests + the new commonsSdkVersionPubspecSync drift guard).

Branch pushed: feat/vsdk-770-mobile-sdk-identity @ 0f3b70b70410b7a88498f2617d0b07796f29852.

The previous ref pointed at the feature branch
`vsdk-769-sdk-identity-override` (now merged). After PR #348 was
merged into `main` on 2026-10-14T05:57:59Z, that branch is fragile:
auto-deletion or a force-push would silently break this Commons
package's resolution.

Pin the dep to the immutable merge commit
`b3c79292a193b2794c55c5cc88c13f9a68947811` on `team-telnyx/flutter-voice-sdk`
(`main`). The merge commit includes `Config.mobile_sdk_name` and
`Config.mobile_sdk_version` and the wrapper override hook in
`version_utils.dart`, so the existing Commons identity plumbing
(sdk_identity.dart, config_helper.dart, session_manager.dart) and
the mobile_sdk_identity_test.dart suite keep working without churn.

This is NOT a fix for Codex P1 #1 ("restore a hosted dependency
before publishing"). That requires a hosted `telnyx_webrtc` release
(>= 4.5.1 / 4.6.0) exposing the identity override on pub.dev; the
upstream release is gated on a maintainer `workflow_dispatch` of
`release-01-create-pull-request.yml` and the bot has no signal yet
that such a release is in flight. The next bot tick after a release
ships will swap this Git dep for a hosted `^4.5.1` (or newer)
constraint.

Verified locally:
- `flutter pub get` → resolves `telnyx_webrtc` from git @ b3c792 in
  packages/telnyx_webrtc (was 4.4.0, now 4.5.0 with the VSDK-769
  identity fields present)
- `flutter analyze` → 30 issues (all pre-existing: example-app
  Firebase config, `avoid_print`, prefer-const in example/, the
  `invalid_dependency` warning for this same Git dep that we
  knowingly carry, plus two deprecated_member_use in
  session_manager.dart unchanged by this PR)
- `flutter test` → 20 tests pass (16 base + 4 new mobile SDK
  identity tests covering credential/token/stored/decorated configs
  and the commonsSdkVersionPubspecSync drift guard)
@g-telnyx

Copy link
Copy Markdown
Collaborator Author

Reviewed the remaining hosted-dependency finding against the current ecosystem state. The push/reconnect and release-version findings are fixed on this branch. The hosted dependency cannot be corrected yet: VSDK-769 is merged to flutter-voice-sdk main at b3c79292, but the latest published telnyx_webrtc release remains 4.5.0 and does not contain the wrapper-identity API. Replacing the pinned Git dependency with ^4.5.0 would compile against an incompatible API; publishing Flutter Commons must therefore wait for the next hosted telnyx_webrtc release, then this PR should switch to that released constraint before merge/release.

@g-telnyx

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ebe593812

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/release/release.sh Outdated
@mobile-sdk-afk

Copy link
Copy Markdown

[afk-bot] Proposed fix for Codex review P1 on scripts/release/release.sh (2026-10-14T08:49:03Z) — cannot be auto-pushed by the AFK implementer because the webrtc-afk-bot GitHub App lacks the workflows: write permission required by GitHub to modify files under .github/workflows/. A maintainer with workflow write access needs to apply this patch (or open a follow-up PR with the same diff) before the next release.

Proposed diff (release-01-create-pull-request.yml)

diff --git a/.github/workflows/release-01-create-pull-request.yml b/.github/workflows/release-01-create-pull-request.yml
index edd35c4..29b05d6 100644
--- a/.github/workflows/release-01-create-pull-request.yml
+++ b/.github/workflows/release-01-create-pull-request.yml
@@ -2,6 +2,10 @@
 #
 # The PR updates:
 # - pubspec.yaml (version)
+# - lib/src/internal/sdk_identity.dart (commonsSdkVersion, kept in lock-step
+#   with the pubspec version by scripts/release/release.sh bump; the
+#   commonsSdkVersionPubspecSync drift-guard test in
+#   test/mobile_sdk_identity_test.dart fails the suite if these two diverge)
 # - CHANGELOG.md, when the COPILOT_PAT secret is set
 #
 # With COPILOT_PAT set, GitHub Copilot drafts the CHANGELOG section from the merged
@@ -199,6 +203,15 @@ jobs:
           branch: release/${{ steps.release.outputs.version }}
           base: main
           delete-branch: true
+          # add-paths MUST include lib/src/internal/sdk_identity.dart because
+          # scripts/release/release.sh bump rewrites commonsSdkVersion to keep
+          # it in lock-step with the pubspec.yaml version (the drift-guard test
+          # in test/mobile_sdk_identity_test.dart fails the suite if these
+          # diverge). Without this entry peter-evans/create-pull-request drops
+          # the SDK-identity edit and the next release identifies itself as the
+          # previous version on the wire (Codex review P1 on PR #49,
+          # 2026-10-14T08:49:03Z).
           add-paths: |
             pubspec.yaml
             CHANGELOG.md
+            lib/src/internal/sdk_identity.dart

Why this fixes the P1

  • scripts/release/release.sh bump already rewrites lib/src/internal/sdk_identity.dart (commonsSdkVersion) in lock-step with pubspec.yaml (see commit 0f3b70b).
  • The current peter-evans/create-pull-request@v6 step restricts add-paths to pubspec.yaml + CHANGELOG.md, so the SDK-identity edit is silently dropped from the generated release PR.
  • Adding lib/src/internal/sdk_identity.dart to add-paths makes the bump commit land atomically with the version bump, which is what the commonsSdkVersionPubspecSync drift-guard test in test/mobile_sdk_identity_test.dart expects.

Suggested application steps

git checkout main
git checkout -b chore/vsdk-770-release-workflow-add-paths
# Apply the diff above (e.g. via `git apply` after pasting into a file, or manually edit)
git add .github/workflows/release-01-create-pull-request.yml
git commit -m "fix(release-01): commit sdk_identity.dart in release PR"
git push -u origin chore/vsdk-770-release-workflow-add-paths
gh pr create --base main --title "fix(release-01): commit sdk_identity.dart in release PR" --body "Addresses Codex review P1 on #49 (2026-10-14T08:49:03Z). See the comment on #49 for context."

Local validation done on the AFK side before the rollback:

  • flutter pub get → resolves telnyx_webrtc from git @ b3c79292 in packages/telnyx_webrtc (4.5.0 with VSDK-769 identity fields)
  • flutter analyze → 30 issues (all pre-existing; no new findings from the workflow edit)
  • flutter test → 20/20 pass (16 base + 4 mobile SDK identity tests covering credential / token / stored credential / stored token configs and the commonsSdkVersionPubspecSync drift-guard)

PR head SHA is unchanged at 8ebe5938129908849f7b6ff6af3f183363245d6c; this fix is a follow-up, not a rebase of the existing 3 commits on the branch.

@g-telnyx

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 7877bc1059

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@wojciechowskiradek wojciechowskiradek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review

What this PR does

Implements VSDK-770: passes flutter_commons identity (name + version) through credential and token configs, preserving it for stored-config and push/reconnect paths. Depends on Flutter core PR #348 (VSDK-769).

Design assessment

Good approach — single source of truth via sdk_identity.dart with shared constants and decorator functions (withCommonsCredentialIdentity / withCommonsTokenIdentity). The stored config is now the decorated version, fixing the push reconnect identity gap that Codex flagged.

Positive

  • sdk_identity.dart centralizes identity literals — one place to change name/version
  • _storedConfig = telnyxConfig (decorated) fixes the push reconnect path dropping identity
  • ConfigHelper.getConfig() also applies identity to restored configs from SharedPreferences
  • Tests cover direct credential/token identity, stored credential restore, and stored token restore
  • Comments explain the decorated-config rationale well (references Codex P1 #2)

Issues to address before merge

  1. Git dependency in pubspec.yaml (Codex P1 #1) — telnyx_webrtc is now a git dependency pinned to commit b3c79292. This will fail pub.dev publication (Git deps are not allowed for published packages). The comment acknowledges this and says it's deferred until upstream ships a release. This PR must NOT be published to pub.dev until the git dep is replaced with a hosted constraint. Consider keeping this PR as draft until the upstream release lands.

  2. Hardcoded version in sdk_identity.dart (Codex P1 #3) — commonsSdkVersion = '0.2.0' is hardcoded. The release script (release.sh) bumps pubspec.yaml but not this file, so every release will signal 0.2.0. Either derive the version from pubspec at runtime (const String commonsSdkVersion = ... from package_info_plus), or add sdk_identity.dart to the release script's bump targets.

  3. Release script add-paths exclusion (Codex P1 #4) — the release workflow's create-pull-request step only commits pubspec.yaml and CHANGELOG.md. If issue #2 is fixed by having the release script edit sdk_identity.dart, that file won't be included in the release PR. The workflow needs updating to also include lib/src/internal/sdk_identity.dart.

  4. release.sh only adds a blank line — the diff to scripts/release/release.sh adds just a blank line (+ at line 147). If the intent was to also bump the identity version here, that's missing. If it's just formatting, it's noise.

Non-blocking observations

  1. Community post version derivation — the iOS PR (#420) pulls version from Bundle.infoDictionary and React Native (#145) from package.json. Flutter could use package_info_plus to read version at runtime, avoiding the hardcoded constant entirely. This would also resolve issues #2 and #3.

  2. effectiveSdkName / effectiveSdkVersion — tests use these accessors which must be from the core SDK (VSDK-769). Not visible in this diff, assumed correct from the core PR.

Verdict

Approve with conditions — the implementation is solid and the stored-config fix is important. However:

  • Do not publish to pub.dev until the git dependency is replaced with a hosted telnyx_webrtc constraint
  • Issues #2 and #3 (hardcoded version + release script) should be addressed before or in the same release cycle to avoid every released package signaling 0.2.0

telnyx_webrtc 4.5.1 is the first hosted release that ships the
top-level Verto mobile_sdk_name / mobile_sdk_version identity
(Flutter core #350, merged 2026-10-15). Replace the temporary
Git pin against fix/vsdk-769-wire-identity-v2 with the hosted
range so consumers get the wire-contract fix without dragging
in the unreleased main branch.

Pinned to ^4.5.1 so consumers opt into future major versions
explicitly rather than being forced onto them.
@g-telnyx
g-telnyx merged commit e490389 into main Oct 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants