Skip to content

fix(ApiUrl): show correct PUBLISH/SUBSCRIBE labels for AsyncAPI operations (@W-21813981)#98

Merged
alexpmule merged 3 commits into
masterfrom
fix/W-21813981-asyncapi-operation-labels
May 21, 2026
Merged

fix(ApiUrl): show correct PUBLISH/SUBSCRIBE labels for AsyncAPI operations (@W-21813981)#98
alexpmule merged 3 commits into
masterfrom
fix/W-21813981-asyncapi-operation-labels

Conversation

@alexpmule

@alexpmule alexpmule commented May 19, 2026

Copy link
Copy Markdown
Contributor

Problem

Since the gRPC support PR (#97), AsyncAPI operations display "CLIENT"/"SERVER" labels instead of the correct "PUBLISH"/"SUBSCRIBE".

Root cause: ApiUrl.js added a local _isGrpcOperation override that matched method names (publish, subscribe) to detect gRPC. This incorrectly flagged all AsyncAPI operations as gRPC. The inherited AmfHelperMixin._isGrpcOperation correctly identifies gRPC by checking payload media type (application/grpc).

Fix

  • Remove the local _isGrpcOperation override (defer to mixin's media-type check)
  • Remove the local _getGrpcStreamType override (same reason)
  • Keep _getGrpcStreamTypeDisplayName and _getMethodForColor (rendering helpers, not in mixin)

Net result: -67 lines. gRPC operations still render correctly; AsyncAPI operations now show their real method name.

Screenshots

AsyncAPI (fixed):

AsyncAPI showing PUBLISH/SUBSCRIBE correctly

gRPC (still works):

gRPC showing Unary/Client/Server/Bidirectional correctly

Tests

  • Added assertions verifying rendered label text for PUBLISH and SUBSCRIBE
  • All 245 tests pass (chromium, firefox, webkit)
  • RED verified: reverting the fix causes 4 test failures

@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Alex Perez <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

…yncAPI operations

The local _isGrpcOperation override in ApiUrl.js treated publish/subscribe
method names as gRPC indicators, causing AsyncAPI operations to display
"CLIENT"/"SERVER" labels instead of "PUBLISH"/"SUBSCRIBE". The inherited
AmfHelperMixin implementation correctly identifies gRPC by payload media type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexpmule alexpmule force-pushed the fix/W-21813981-asyncapi-operation-labels branch from 302d6af to 29fc905 Compare May 19, 2026 03:57
Verify that the method-label element displays PUBLISH/SUBSCRIBE
(not CLIENT/SERVER) for AsyncAPI operations in both compact and full models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexpmule alexpmule self-assigned this May 20, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexpmule alexpmule changed the title @W-21813981 fix: remove incorrect gRPC override that misidentified As… fix(ApiUrl): show correct PUBLISH/SUBSCRIBE labels for AsyncAPI operations (@W-21813981) May 20, 2026
@alexpmule alexpmule merged commit ab29b64 into master May 21, 2026
4 checks passed
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.

2 participants