-
Notifications
You must be signed in to change notification settings - Fork 5
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
[MOB-3028] Ecosia Framework #816
base: main
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍(Review updated until commit 9d779a9)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 9d779a9
Previous suggestionsSuggestions up to commit e5bca0a
|
014322f
to
530e2ea
Compare
BrowserKit/Sources/SiteImageView/ImageProcessing/BundleImageFetcher/BundleImageFetcher.swift
Outdated
Show resolved
Hide resolved
5521edf
to
aab2edd
Compare
Many updates were part of this series of commits. The goals of it were essentially these:
I tried to follow each of the steps, always taking into account a smoother integration as part of the upcoming upgrade 🚀 . Let's highlight the major changes worth noticing. Dependency in BrowserKitThere was an annoying dependency on Core in BrowserKit as part of the After spending a considerable amount of time looking for a robust solution, I realized that the best approach in this very niche scenario would be to directly implement a part of our Some files are still in the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! It runs very smoothly and feels great to have it all in one repo ❤️ 👏
I'm only halfway through so far (so many files 🙈) but already added some comments we can talk about, nothing major, let me know what you think.
BrowserKit/Sources/SiteImageView/ImageProcessing/BundleImageFetcher/BundleImageFetcher.swift
Outdated
Show resolved
Hide resolved
@lucaschifino tackled all the comments 💪 - feel free to move forward with the review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good from my side 👏
Raised a small internal point on this ticket comment.
Persistent review updated to latest commit 9d779a9 |
|
||
let request = SingularConversionValueRequest(.init(identifier: sessionIdentifier, eventName: event.rawValue, appDeviceInfo: appDeviceInfo), | ||
skanParameters: persistedValuesDictionary) | ||
let response = try await singularService.getConversionValue(request: request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a check to ensure that the response from singularService.getConversionValue
is not nil before proceeding. This can prevent potential crashes. [important]
private func save() { | ||
let user = self | ||
User.queue.async { | ||
try? JSONEncoder().encode(user).write(to: FileManager.user, options: .atomic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement a debounce mechanism or batch updates to reduce the frequency of disk writes in the save
method. This will improve performance. [important]
User.shared.searchCount = 1234 | ||
User.shared.id = "neverland" | ||
|
||
let incognitoDict = Cookie.makeIncognitoCookie(urlProvider).value.components(separatedBy: ":").map { $0.components(separatedBy: "=") }.reduce(into: [String: String]()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the dictionary reduction logic into a helper function to improve readability and reduce code duplication. [medium]
} | ||
|
||
let persistedCoarseValue: Int? = getUserDefaultsInteger(for: .coarseValue(window: window)) | ||
setUserDefaults(for: .coarseValue(window: window), value: coarseValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the persistUpdatedValues
function to eliminate repetitive calls to setUserDefaults
by using a loop or a mapping structure. [medium]
let search = URL(string: "https://www.www.ecosia.org/search?q=foo")!.ecosified(isIncognitoEnabled: false, urlProvider: self.urlProvider) | ||
XCTAssertEqual(search, URL(string: "https://www.www.ecosia.org/search?q=foo&_sp=\(id.uuidString)")) | ||
|
||
let alreadyPatched = URL(string: "https://www.www.ecosia.org/search?q=foo&_sp=12345")!.ecosified(isIncognitoEnabled: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extend the testPatchWithAnalyticsId
test to include cases where the URL already contains query parameters other than _sp
. This will ensure robust URL handling. [medium]
@lucaschifino, just to keep everything tracked and as transparent as possible, I'll also comment here on the decision not to implement those Codium suggestions for now. |
9d779a9
to
16d3d4f
Compare
MOB-3028
Context
As a first step towards moving Core into Client, we want to create an Ecosia framework and move Braze into it.
This was jump started while pairing with @d4r1091 🙂
Approach
Other
Before merging
Checklist