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 #2584: No longer check clipboard if ref code exists on launch. #2585

Merged
merged 27 commits into from May 27, 2020
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7101d33
Added support for pre-determined / binary related ref codes.
jhreis May 11, 2020
646e5bd
Clipboard processing added.
jhreis May 11, 2020
2359577
Merge branch 'development' into referral_fixes
jhreis May 11, 2020
624dabc
Clear clipboard after successful ref promo read.
jhreis May 11, 2020
15bfead
Cleaned up code a bit, no functional changes.
jhreis May 18, 2020
6fdb085
Added ref code validation.
jhreis May 18, 2020
8214d99
Changed ref code sanitzation to use regex.
jhreis May 18, 2020
285fe1e
Added unit tests for ref code sanitization.
jhreis May 18, 2020
aaa762e
Removed unnecessary comment.
jhreis May 18, 2020
3ce30ea
Merge branch 'development' into referral_fixes
jhreis May 18, 2020
16d5037
Added path components helper to avoid manually adding forward slashes.
jhreis May 18, 2020
576ae4a
Comment cleanup.
jhreis May 20, 2020
834a1fc
Fixed crash from bad referral situation.
jhreis May 20, 2020
98253b6
Fixed S3 bucket endpoint for enterprise builds.
jhreis May 21, 2020
ade056f
Merge branch 'development' into referral_fixes
jhreis May 21, 2020
411481f
Fix #2565: Retry ref code lookup on subsequent launches.
jhreis May 22, 2020
17f0717
Merge branch 'development' into referral_fixes
jhreis May 22, 2020
c8e6630
Merge branch 'referral_fixes' into fix-2565
jhreis May 22, 2020
6bcc4f9
Merge remote-tracking branch 'origin/development' into fix-2565
iccub May 25, 2020
9f20fc8
Merge remote-tracking branch 'origin/development' into fix-2565
iccub May 25, 2020
24744c4
Merge branch 'development' into fix-2565
jhreis May 26, 2020
aae0eb8
Fixed URP lookup flag placement.
jhreis May 26, 2020
92f0562
Add retry timer.
iccub May 27, 2020
78d2f75
Move to struct.
iccub May 27, 2020
6c8edfc
Fix #2584: No longer check clipboard if ref code exists on launch.
jhreis May 27, 2020
d55b022
Merge branch 'fix-2565' into fix-2584
jhreis May 27, 2020
350f766
Merge branch 'development' into fix-2584
jhreis May 27, 2020
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fixed crash from bad referral situation.

  • Loading branch information
jhreis committed May 20, 2020
commit 834a1fcd47d7ae55cac2d571a5cf34ed83216351
@@ -196,7 +196,11 @@ public class UserReferralProgram {
/// Uses very strict matching.
/// Returns the sanitized code, or nil if no code was found
public class func sanitize(input: String?) -> String? {
guard var input = input, input.hasPrefix(self.clipboardPrefix) else { return nil }
guard
var input = input,
input.hasPrefix(self.clipboardPrefix),
input.count > self.clipboardPrefix.count
else { return nil }

// +1 to strip off `:` that proceeds the defined prefix
input.removeFirst(self.clipboardPrefix.count + 1)
@@ -56,6 +56,9 @@ class UserReferralProgramTests: XCTestCase {

response = UserReferralProgram.sanitize(input: "\(UserReferralProgramTests.clipboardPrefix):")
XCTAssertNil(response)

response = UserReferralProgram.sanitize(input: "\(UserReferralProgramTests.clipboardPrefix)")
XCTAssertNil(response)
}

func testNoSpacer() throws {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.