Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Multiple MicroAgent undefined session and limit available API #1252

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

cwli24
Copy link
Contributor

@cwli24 cwli24 commented Nov 13, 2024

MicroAgent class now only shows the relevant API for use with NPM. The set is limited to methods that relate to features available with the MicroAgent. An issue with missing session when multiple MicroAgents are initialized is also fixed.

Overview

MicroAgent is trimmed down to the 10 methods, including start, that are relevant. The full set of api.js is still imported and set, but the public interface or users' IDE will not list the other methods used by non-MicroAgent features.

Previously, when initializing more than one MicroAgent, the session object remains undefined on the second and onward instances, causing only one of multiple MicroAgent to have/report a session. This is fixed here so now all microagent will have a valid session of the same session ID.

Related Issue(s)

https://new-relic.atlassian.net/browse/NR-289146
https://new-relic.atlassian.net/browse/NR-328644

Testing

Copy link

github-actions bot commented Nov 13, 2024

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 29.15 kB / 10.59 kB (gzip) 29.24 kB / 10.6 kB (gzip) 0.28% / 0.14% (gzip)
lite async-chunk 53.71 kB / 17.48 kB (gzip) 53.75 kB / 17.44 kB (gzip) 0.08% / -0.19% (gzip)
pro loader 50.21 kB / 17.37 kB (gzip) 50.3 kB / 17.39 kB (gzip) 0.17% / 0.1% (gzip)
pro async-chunk 99.95 kB / 30.54 kB (gzip) 99.99 kB / 30.5 kB (gzip) 0.04% / -0.15% (gzip)
spa loader 57.8 kB / 19.69 kB (gzip) 57.88 kB / 19.7 kB (gzip) 0.15% / 0.06% (gzip)
spa async-chunk 114.67 kB / 34.82 kB (gzip) 114.71 kB / 34.78 kB (gzip) 0.04% / -0.09% (gzip)

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 18.57143% with 57 lines in your changes missing coverage. Please review.

Project coverage is 89.21%. Comparing base (e0a8494) to head (9cc5a93).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/loaders/micro-agent-base.js 3.03% 31 Missing and 1 partial ⚠️
src/loaders/micro-agent.js 0.00% 19 Missing and 4 partials ⚠️
src/loaders/agent-base.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1252      +/-   ##
==========================================
+ Coverage   89.08%   89.21%   +0.12%     
==========================================
  Files         169      170       +1     
  Lines        7351     7331      -20     
  Branches     1476     1476              
==========================================
- Hits         6549     6540       -9     
+ Misses        682      671      -11     
  Partials      120      120              
Flag Coverage Δ
integration-tests 91.88% <45.00%> (-0.03%) ⬇️
unit-tests 79.80% <20.33%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link

github-actions bot commented Nov 14, 2024

Static Badge

Last ran on November 15, 2024 12:57:52 CST
Checking merge of (9cc5a93) into main (e0a8494)

@cwli24 cwli24 changed the title fix: Limit MicroAgent API based on available features fix: Multiple MicroAgent undefined session and limit API to available features Nov 14, 2024
@cwli24 cwli24 changed the title fix: Multiple MicroAgent undefined session and limit API to available features fix: Multiple MicroAgent undefined session and limit available API Nov 14, 2024
@cwli24 cwli24 merged commit 19cbb63 into main Nov 18, 2024
31 of 34 checks passed
@cwli24 cwli24 deleted the micro-agent-typedef branch November 18, 2024 16: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.

2 participants