Api incompatibility caused by minor version change #10576
Replies: 3 comments 7 replies
-
All Sentry SDKs used on a page should have the same version for the most correct behaviour. In the model you displayed above you are also increasing bundle size for your users by having two different versions of the SDK. Although public API does not break in minor versions, improvements in instrumentation patching or event processing might be made, which is why we need to enforce this for correctness. I recommend you build an abstraction over the sentry sdks to ensure that all your microfrontends use the same version whenever possible. |
Beta Was this translation helpful? Give feedback.
-
Hi there @AbhiPrasad, and thanks @bastikempken for writing up this issue, as we're running into it as well. We have Microfrontends, each of which loads their own copy of Being required to all be on the same version is unrealistic in our setup: We have individual teams that are on their own upgrade schedules, we cannot all coordinate upgrading at the same time (this is the reason these teams opted for Microfrontends in the first place). Further, even if we did have some form of dependency sharing, we'd be unable to guarantee that Microfrontends could actually adopt the "shared" version at the time the host upgraded it. When Sentry APIs do change (for example, removing Nothing in the Microfrontend documentation indicates that dependency sharing (or module federation) is required. We know the benefits, and have not yet decided that the tradeoffs are right for us. So that makes every Sentry upgrade onerous for us, forcing us to coordinate all of the teams to upgrade at the same time... While I understand the benefits of keeping Sentry versions isolated, I don't think the current approach fits well with the reality of Microfrontends. |
Beta Was this translation helpful? Give feedback.
-
Right, sorry, I wasn't totally clear. We are currently on a mix of v7 versions amongst our microfrontends and host. We discovered this issue when attempting to upgrade to 8. In order to ensure that we don't have an observability gap during the upgrade to v8, we want to cover all the way back to v7. Our aim is to get everyone on latest.
I think our concerns are a little different. My concern is that we don't control Sentry, so if access to the version carrier somehow changes, our function would have to be updated in concert. I understand the team's concern regarding version compatibility, but I am hoping to identify a Sentry offering that doesn't require us to maintain a workaround. We'll consider the other two offerings, though I'll share my initial thoughts/questions here:
Thanks for the additional suggestions, we'll consider our options here. |
Beta Was this translation helpful? Give feedback.
-
Introduction
We use sentry in a microfrontend context, where the microfrontend applications are owned by different teams. Every team should build and run it's application mostly independent. This includes dependency management.
The entire appliction is assembled by the application shell architecture pattern which although provides central functions at runtime.
One of these functions is a central sentry hub reporting runtime errors from all the different microfrontend applications. To route error events depending on the responsible microfrontends, we use the concept of
ModuleMetadata
andmakeMultiplexedTransport
. The implementation follows the documented recommendations.This works fine for unhandled errors and errors events from the CaptureConsole integration. In addition some teams have the usecases to use sentry specific apis like
captureMessage
.For that reason the
@sentry/browser
dependency is installed in microfrontends beside the installation in the application shell. This means sentry apis likecaptureMessage
are called from a different@sentry/browser
version than the one which is used to init the central sentry hub in the application shell.Problem
With the following pull request #9732 a much more restrictive version check was introduced to avoid api incompatibility. In the described context this is a hard to handle problem, because the used version of the
@sentry/browser
dependency in a microfrontend has always to be equal or lower than the one used in the application shell used to init the sentry hub. This is even the case for minor version changes. In case of an critical minor version difference no sentry error event is sent.Question
Is it really necessary that the implemented version check, judges a minor version difference as a incompatibility? Should't that be the case only for major version changes, at least from a sematic versioning perspective ?
cc @AbhiPrasad
Beta Was this translation helpful? Give feedback.
All reactions