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

ensure mobx is configured before stores are instantiated #455

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

macfarlandian
Copy link
Collaborator

@macfarlandian macfarlandian commented Jul 14, 2021

Description of the change

Moves the MobX configuration call into the RootStore module to ensure it is run before we instantiate stores. Because Proxies are enabled by default (and IE 11 does not support Proxies), this makes sure we disable proxies before any observables are created by Mobx.

This was causing the ND site to fail in production in IE 11 because some observable data is created by the store constructors — but only when a custom tenant domain is detected. This would cause an error because the RootStore is instantiated in the body of a module that would run when imported by /src/index.tsx, before calling configure in the body of the index module. (Tricky — I was ultimately able to repro this locally by hacking the getTenantFromDomain function to always return a tenant ID, and to verify the fix by the same means.)

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Related issues

Closes #454

Checklists

Development

These boxes should be checked by the submitter prior to merging:

  • Manual testing against realistic data has been performed locally

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has been moved out of a Draft state, has no "Work In Progress" label, and has assigned reviewers
  • Potential security implications or infrastructural changes have been considered, if relevant

@coveralls
Copy link

coveralls commented Jul 14, 2021

Pull Request Test Coverage Report for Build 1031797705

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 84.977%

Files with Coverage Reduction New Missed Lines %
spotlight-client/src/index.tsx 1 0%
Totals Coverage Status
Change from base Build 1031651634: 0.03%
Covered Lines: 1940
Relevant Lines: 2161

💛 - Coveralls

Copy link

@jovergaag jovergaag left a comment

Choose a reason for hiding this comment

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

We had to do the same thing a few months ago!

@macfarlandian
Copy link
Collaborator Author

good to know! thanks 🙌🏻

@macfarlandian macfarlandian merged commit fbff379 into main Jul 15, 2021
@macfarlandian macfarlandian deleted the ian/454-ie-proxy branch July 15, 2021 19:07
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.

Site broken in IE 11
3 participants