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 the startTransaction init error for development env #3040

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

akshay-gupta7
Copy link
Contributor

fixes the following error on console:

  • "Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'" (only in dev enc)

macintoshhelper and others added 2 commits July 26, 2024 20:06
* [WIP] webpack config setup for fast refresh + websocket server

* add prod/dev hmr webpack config option

* render immediately and handle AsyncMessage in startup app hook

* forward ui AsyncMessages to browser via WebSockets

* null check sentry transaction to fix browser error

* refactor AsyncMessageChannel code for browser implementation

* webpack use swc-loader for browser version + speed/bundle size plugin options

* prettify browser dev preview UI

* enable loading screen if startup params missing (for web serve + disconnected browser dev preview)

* attempt to fix webpack build for tests

* add SpeedMeasurePlugin package

* create AsyncMessageChannel dev docs

* replace web-preview.md ASCII data flow diagram with mermaid

* use radii/spacing tokens instead of px for web preview.tsx styles

Co-authored-by: Jan Six <[email protected]>

* remove commented out startup handler (handled in startup.tsx useEffect now)

Co-authored-by: Jan Six <[email protected]>

* remove commented out code

Co-authored-by: Jan Six <[email protected]>

* replace px values with tokens

Co-authored-by: Jan Six <[email protected]>

* conditional export for AsyncMessageChannel preview env

* add browser preview WEBSOCKETS_PORT env

* fix typescript issue with PreviewAsyncMessageChannel.isWsConnected

* add test coverage for AsyncMessageChannelPreview

* Browser preview debug UI (#2803)

* fix AsyncMessageChannelPreview undefined error + export WS URI

* browser preview CSS file for UI fixes

* create previewUtils for browser color scheme + setFigmaBrowserTheme

* browser preview URL params + fullscreen/theme/action modes

* two bug fixes for browser/plugin websocket preview bridge

* add preview dist folder for web preview builds

* [WIP] browser preview dev knowledge docs

* feat(dev): request startup on browser preview page open

* refactor(dev): use env vars for browser preview ws src

* fix(debug): remove console.log from asyncmessagechannelpreview

* fix(css): figmaloading full height css for browser preview

* refactor(dev): use enums for websockets src in browser preview tsx

* fix(dev): remove comments

* refactor: reuse htmlClassList variable

* remove unused package

---------

Co-authored-by: macintoshhelper <[email protected]>

---------

Co-authored-by: macintoshhelper <[email protected]>
Co-authored-by: Jan Six <[email protected]>
@akshay-gupta7 akshay-gupta7 self-assigned this Jul 31, 2024
Copy link

changeset-bot bot commented Jul 31, 2024

⚠️ No Changeset found

Latest commit: 44bb43f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 31, 2024

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

Copy link
Contributor

github-actions bot commented Jul 31, 2024

Commit SHA:b9c231cc5ffbd26c3c28a6e5375b025397f35ff7

Test coverage results 🧪

Code coverage diff between base branch:dx and head branch: fix-console-errors 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 66.84 (-0.01) 57.85 (-0.01) 63.78 (0) 67.19 (-0.02)
🔴 packages/tokens-studio-for-figma/src/app/sentry.ts 38.88 (-4.87) 40 (-2.85) 0 (0) 38.88 (-4.87)

Copy link
Contributor

github-actions bot commented Jul 31, 2024

Commit SHA:b9c231cc5ffbd26c3c28a6e5375b025397f35ff7
Current PR reduces the test coverage percentage by 1 for some tests

@@ -30,6 +30,7 @@ export const initializeSentry = () => {
switch (process.env.ENVIRONMENT) {
case 'alpha':
case 'beta':
case 'development':
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesnt this mean we are also tracking errors in development ? Do we want that? Wouldnt Sentry get overloaded with errors that we dont care about because theyre not in prod or any beta version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, I will disable error log collection for dev environment

Comment on lines +47 to +58
break;
case 'development':
Sentry.init({
dsn: '',
release: `figma-tokens@${pjs.version}`,
environment: process.env.ENVIRONMENT,
tracesSampleRate: 0,
profilesSampleRate: 0,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
integrations: [],
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

does this make sense @six7

Base automatically changed from dx to main October 24, 2024 08:33
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