Api incompatibility caused by minor version change #10576
Replies: 1 comment
-
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.
-
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