Skip to content

fix: fixing and exporting mergeMessages()#550

Merged
arbrandes merged 2 commits into
openedx:masterfrom
hammerlabs-net:fix-mergeMessages
Aug 30, 2023
Merged

fix: fixing and exporting mergeMessages()#550
arbrandes merged 2 commits into
openedx:masterfrom
hammerlabs-net:fix-mergeMessages

Conversation

@pedromartello
Copy link
Copy Markdown
Contributor

@pedromartello pedromartello commented Aug 25, 2023

Fixed and exported the internal function mergeMessages() and refactored unit-tests to cover the new behavior. Previously this method would return an object identical to the one passed in (or an object version of an array passed in) and ignore/clobber any messages previously supplied. The new version fixes this function to actually merge new messages with existing ones.

The method was never exported outside the package and the only internal use was in the configure() method which is refactored in this PR to use lodash.merge() directly.

These changes support OEP-65 and the related work in the repository frontend-app-shell which uses the Piral framework to federate MFEs.

With existing MFE's which are deployed and run independently, there is never a need to merge messages into frontend-platform after initialization is completed. However, with federated MFEs, they need the ability to append new messages to those already loaded. This change supports this requirement.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 25, 2023
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @pedromartello! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 28, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 30, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03% 🎉

Comparison is base (26001c9) 83.05% compared to head (1a4203c) 83.08%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
+ Coverage   83.05%   83.08%   +0.03%     
==========================================
  Files          40       40              
  Lines        1062     1064       +2     
  Branches      195      194       -1     
==========================================
+ Hits          882      884       +2     
  Misses        168      168              
  Partials       12       12              
Files Changed Coverage Δ
src/i18n/lib.js 98.24% <100.00%> (+0.06%) ⬆️

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

Copy link
Copy Markdown
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Nice! It looks like that utility function now actually has a utility, now. :)

Tested, and has no ill effects in existing MFEs. (Not that any of them actually used this function, AFAICT.)

@arbrandes arbrandes merged commit 98a1b96 into openedx:master Aug 30, 2023
@openedx-webhooks
Copy link
Copy Markdown

@pedromartello 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@arbrandes arbrandes removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants