Skip to content

Feature/clever support#1

Open
Neckk wants to merge 20 commits into
developfrom
feature/cleverSupport
Open

Feature/clever support#1
Neckk wants to merge 20 commits into
developfrom
feature/cleverSupport

Conversation

@Neckk

@Neckk Neckk commented Jun 2, 2020

Copy link
Copy Markdown
Owner

What's this do?
[Description of what this PR does goes here]

Why are we doing this? (w/ JIRA link if applicable)
[Quick blurb about why the code is needed and Jira link goes here / Do these changes meet the business requirements of the story?]

How should this be tested? / Do these changes have associated tests?
[Description of any tests that need to be performed once merged goes here]

Dependencies for merging? Releasing to production?
[Description of any watchouts, dependencies, or issues we should be aware of goes here]

Has the application documentation been updated for these changes?

Did someone actually run this code to verify it works?

@ettore ettore left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The general approach makes sense to me, I did not follow everything that's happening, and some changes ill require a lot of testing. I would recommend some things:

  • do you think you can split this into smaller PRs?
  • even better, could some of the refactors / swift-rewrites here be done in individual PR? That way we could merge this code to develop incrementally and ship it in several versions of SimplyE. This would limit possible breakages greatly.
  • otherwise, this PR would definitely need to go into a feature branch and test it thoroughly before being merged down.

I think @kyles_ep should also take a look because he has more history on this code base and app than myself.

In any case thanks for these refactors!

Comment thread Simplified/Account.swift
struct Authentication {
@objc(AccountDetailsAuthentication)
@objcMembers
class Authentication: NSObject, Codable, NSCoding {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you keep the classname the same between Swift and Objc? Easy to rename the Swift one if needed. This way the codebase would be much easier to browse IMO.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

AccountDetailsAuthentication because Authentication struct is nested inside AccountDetails struct. I wasn't able to access this struct otherwise in objc, but I might take a second look into this.

struct AccountDetails {
struct Authentication {
}
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I don't think it's possible to use nested types in Objective-C. And I'm afraid of name collision in case there is another Authentication type in future. I'd leave it as it currently is.

Comment thread Simplified/Account.swift Outdated
Comment thread Simplified/Accounts.json
Comment thread Simplified/AccountsManager.swift Outdated
Comment thread Simplified/KeychainStoredVariable.swift Outdated

- (UIView *)tableView:(UITableView *)__unused tableView viewForFooterInSection:(NSInteger)section
{
// something's wrong, it gets called every refresh cycle when scrolling

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

feel free to file a ticket for later. We add TODO: SIMPLY-123 comments to track it back.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I managed to solve the same issue for header by adding a strong reference to returned view by storing it in view controller, but it didn't seem to work in this case. I'll need to prepare some steps to replicate and will create a ticket :)

Comment thread Simplified/NYPLSignInBusinessLogic.swift Outdated
private lazy var _authorizationIdentifier: KeychainVariable<String> = StorageKey.authorizationIdentifier
.keyForLibrary(uuid: libraryUUID)
.asKeychainVariable(with: accountInfoLock)
private lazy var _adobeToken: KeychainVariable<String> = StorageKey.adobeToken

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

did you test this is backward compatible once a user upgrades to this code? This set of changes would require a meticulous QA effort. @kyles_ep knows more about this area of the code.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Besides token, pin and barcode, other variables SHOULD work on par with old logic, I'll do more tests to verify it

Comment thread Simplified/NYPLUserAccount.swift
Comment thread Simplified/Network/NYPLNetworkExecutor.swift
@ettore

ettore commented Jul 7, 2020

Copy link
Copy Markdown

just wondering, this PR is now obsolete, correct? Since it's superseded by the 2 more recent PRs I think?

@Neckk

Neckk commented Jul 7, 2020

Copy link
Copy Markdown
Owner Author

just wondering, this PR is now obsolete, correct? Since it's superseded by the 2 more recent PRs I think?

yes, that's right. The newer PRs are based on this code, but some of the things changed meantime

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.

2 participants