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: logger uses updated message and modal properties #21

Merged
merged 16 commits into from
Jan 31, 2024

Conversation

Seavenly
Copy link
Collaborator

@Seavenly Seavenly commented Dec 27, 2023

Description

Primary changes consist of refactoring the Logger (renamed Analytics) to incorporate message an modal updated values in the analytics payload. Instead of having the analytics logger class instances responsible for keeping track of the message and modal property state effectively duplicating it, the message and modal classes are passed into the logger. Any time an event payload needs to be generated it will just read directly from the message and modal instances with the latest state.

Primary changes:

  • Rename Logger to Analytics
  • Use message and modal references to read latest state when assembling payload
  • Move the responsibility of managing different loggers based on client ID from the top level Logger (renamed AnalyticsService) to the CloudEvent class which is now responsible for taking in all AnalyticsLogger instances and creating the appropriate amount of CloudEvents to be logged
  • Include merchantProfileHash as component level property so it can be read from the logger
  • Refactored view model instantiation order to help simplify the flow since the logger instances now require component references
    • Explicitly pass messageParameters into the refreshContent protocol method to address timing issue with tests from the view model change

Other changes:

  • Include missing version and integration_type with the message and modal requests
  • Change log(.info, ...) to log(.debug, ...) to reduce noise for live environments
  • Include missing merchantID and partnerAttributionID on modal view controller
  • Change modal to lazy instantiation since that is what was happening in a more implicit way

NOTE: Depends on changes from #20

Screenshots

N/A

Testing instructions

N/A

@Seavenly Seavenly requested a review from yeul December 27, 2023 16:54
@Seavenly Seavenly force-pushed the logger-includes-updated-message-properties branch from d54be96 to 8bebf3b Compare January 5, 2024 16:44
Base automatically changed from message-view-request-mocks to develop January 29, 2024 16:57
@Seavenly Seavenly merged commit 6b9e949 into develop Jan 31, 2024
4 of 5 checks passed
@Seavenly Seavenly deleted the logger-includes-updated-message-properties branch January 31, 2024 13:32
github-actions bot pushed a commit that referenced this pull request Apr 22, 2024
## 1.0.0-alpha.1 (2024-04-22)

### Features

* message and modal close button alternative a11y text ([#28](#28)) ([f017015](f017015))

### Bug Fixes

* correctly init AnyCodable for modal event properties ([#10](#10)) ([d4a0839](d4a0839))
* disable opening modal until message rendered ([#4](#4)) ([3d09576](3d09576))
* ensure modal shared key removed from individual events ([#13](#13)) ([32ae124](32ae124))
* logger uses updated message and modal properties ([#21](#21)) ([6b9e949](6b9e949))
* message and modal accessibility improvements ([#7](#7)) ([86320e9](86320e9))
* move credential override off main thread ([#11](#11)) ([b30c2f8](b30c2f8))
* pass env param to log functions ([#31](#31)) ([610d9e3](610d9e3))
* unrecoverable error state after supplying valid client id ([#5](#5)) ([da5fe52](da5fe52))

### Code Refactoring

* add privacy manifest file and remove tracking IDs ([#30](#30)) ([8400d96](8400d96))
* expose proxy and remove environment default param ([#3](#3)) ([a8d36d8](a8d36d8))
* include default device ID and session ID values ([#25](#25)) ([e34fc94](e34fc94))
* include response details when message failure ([#29](#29)) ([dd1c478](dd1c478))
* log endpoint schema and route changes ([#12](#12)) ([31ba3b5](31ba3b5))
* move stageTag and devTouchpoint options to Environment enum ([#15](#15)) ([d4a9d4a](d4a9d4a))
* pass instance_id ([#9](#9)) ([6d0668b](6d0668b))
* pass message view model dependencies from message view ([#20](#20)) ([9a98326](9a98326))
* placement to pageType and textAlignment to textAlign ([#26](#26)) ([d2ffdd4](d2ffdd4))
* remove currency references ([#14](#14)) ([751c903](751c903))
* rename stage environment value to develop ([#27](#27)) ([83557df](83557df))
* store merchant profile data by client ID and merchant ID ([#19](#19)) ([a502a4f](a502a4f))

### Tests

* expand unit tests  ([#8](#8)) ([48e6f0f](48e6f0f))
* expose view model flush method for consistent tests ([#24](#24)) ([9c1406f](9c1406f))

### Continuous Integration

* codesign xcframework build ([90599d0](90599d0))
* fix linting and test coverage ([#17](#17)) ([3eeebea](3eeebea))
* initial GitHub Actions setup and test ([#1](#1)) ([43d9ff0](43d9ff0))
* initial prerelease fixes ([#16](#16)) ([43cffed](43cffed))
* prerelease prep ([#6](#6)) ([12cb440](12cb440))
Copy link

🎉 This PR is included in version 1.0.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request May 14, 2024
## 1.0.0 (2024-05-14)

### Features

* message and modal close button alternative a11y text ([#28](#28)) ([f017015](f017015))

### Bug Fixes

* convert int to string and ensure channel for logger payload ([#32](#32)) ([6794360](6794360))
* correctly init AnyCodable for modal event properties ([#10](#10)) ([d4a0839](d4a0839))
* disable opening modal until message rendered ([#4](#4)) ([3d09576](3d09576))
* ensure modal shared key removed from individual events ([#13](#13)) ([32ae124](32ae124))
* include integration_name with requests ([#34](#34)) ([d5bc8a8](d5bc8a8))
* logger uses updated message and modal properties ([#21](#21)) ([6b9e949](6b9e949))
* message and modal accessibility improvements ([#7](#7)) ([86320e9](86320e9))
* move credential override off main thread ([#11](#11)) ([b30c2f8](b30c2f8))
* pass env param to log functions ([#31](#31)) ([610d9e3](610d9e3))
* unrecoverable error state after supplying valid client id ([#5](#5)) ([da5fe52](da5fe52))

### Code Refactoring

* add privacy manifest file and remove tracking IDs ([#30](#30)) ([8400d96](8400d96))
* expose proxy and remove environment default param ([#3](#3)) ([a8d36d8](a8d36d8))
* include default device ID and session ID values ([#25](#25)) ([e34fc94](e34fc94))
* include response details when message failure ([#29](#29)) ([dd1c478](dd1c478))
* log endpoint schema and route changes ([#12](#12)) ([31ba3b5](31ba3b5))
* move stageTag and devTouchpoint options to Environment enum ([#15](#15)) ([d4a9d4a](d4a9d4a))
* pass instance_id ([#9](#9)) ([6d0668b](6d0668b))
* pass message view model dependencies from message view ([#20](#20)) ([9a98326](9a98326))
* placement to pageType and textAlignment to textAlign ([#26](#26)) ([d2ffdd4](d2ffdd4))
* remove currency references ([#14](#14)) ([751c903](751c903))
* rename stage environment value to develop ([#27](#27)) ([83557df](83557df))
* store merchant profile data by client ID and merchant ID ([#19](#19)) ([a502a4f](a502a4f))

### Tests

* expand unit tests  ([#8](#8)) ([48e6f0f](48e6f0f))
* expose view model flush method for consistent tests ([#24](#24)) ([9c1406f](9c1406f))

### Continuous Integration

* codesign xcframework build ([#33](#33)) ([9ef181d](9ef181d))
* fix linting and test coverage ([#17](#17)) ([3eeebea](3eeebea))
* initial GitHub Actions setup and test ([#1](#1)) ([43d9ff0](43d9ff0))
* initial prerelease fixes ([#16](#16)) ([43cffed](43cffed))
* prerelease prep ([#6](#6)) ([12cb440](12cb440))
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants