Skip to content

Conversation

@bummytime
Copy link
Contributor

This PR builds off of #369 and adds the Storage + Yosemite framework logic for site settings. Stuff added here:

  • Storage: Added a new the v5 data model which contains the SiteSetting entity
  • Storage: Added loadSiteSettings() and loadSiteSetting() to StorageType+Extensions
  • Yosemite: Added StorageSiteSettings and SiteSetting typealiases
  • Yosemite: Added ReadOnlyType and ReadOnlyConvertible extensions for SiteSetting
  • Yosemite: Added SettingStore store
  • Yosemite: Added SettingAction.retrieveSiteSettings() action
  • Yosemite: Added a bunch of unit tests in SettingStoreTests

Note: This code is not wired up to the main app yet — next PR will have that. 😄

Partially addresses #312

Testing

  1. Verify the code is sound
  2. Make sure everything builds and runs without issue
  3. Verify the unit tests are ✅

@jleandroperez Could you take a 👀 at this PR? Thanks!!! 🙇

(It's a large PR again because of the test JSON ... sorry!)

@bummytime bummytime added the type: bug A confirmed bug. label Oct 23, 2018
@bummytime bummytime added this to the 0.10 milestone Oct 23, 2018
@bummytime bummytime self-assigned this Oct 23, 2018
@wpmobilebot
Copy link
Collaborator

1 Warning
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 Danger

Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

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

Looks great!! Just one comment in the Sync'ing mechanism.

Feel free to :shipit: once patched!!

}
}
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just nuke this guard (L64 - L72). In the eventuality of an empty readOnlySiteSettings collection:

  1. The loop below (L75) would run zero times
  2. The cleanup snippet (L85) would just perform the exact same deletion

And most important (just noticed!) the saveIfNeeded call is only performed in L93. (So!) if i did miss anything, and the guard cannot be removed, we'd just need to add a save call before L71.

@bummytime
Copy link
Contributor Author

@jleandroperez Nice catch on that superfluous guard, thank you! 🙇 Updates made.

@bummytime bummytime merged commit 9f8cbfd into develop Oct 24, 2018
@bummytime bummytime deleted the fix/312-currency-mark2 branch October 24, 2018 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants