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

Notifications: Added NotificationStore and friends #396

Merged
merged 20 commits into from
Nov 2, 2018

Conversation

bummytime
Copy link
Member

@bummytime bummytime commented Nov 1, 2018

This PR:

  • Adds NotificationStore and NotificationAction
  • Updates the CD Model + Note NSMO to store subject, header, body, and meta as binary objects
  • Adds a notion of derived storage to StorageManagerType (needed when saving/updating notifications in storage)
  • Updates MockupNetwork such that a FIFO response queue can used — useful for testing the same endpoint where multiple responses are needed sequentially (e.g. notifications)

Re: #19

Testing

  • Check over the code
  • Make sure the unit tests are ✅

@jleandroperez finally ready for a review now!

… issue/19-notifications-yosemite

* 'develop' of github.com:woocommerce/woocommerce-ios: (37 commits)
  Better named variables
  AddANoteViewController: Wiring SwitchTableViewCell
  PrivacySettingsViewController: Wiring SwitchTableViewCell
  SwitchTableViewCell: Standard Subtitle UITableViewCell + Switch
  Write a unit test for a user opt-out scenario
  Missed a typo
  Clear tracks user data when a user opts out
  Fix broken pragma mark
  Give Privacy Settings table and Order Details table some empty space where footer would go
  Make  changes for Crashlytics - turn off crash reporting if Collect info setting is turned off.
  Change method names from `optedOut` to `optedIn`
  Move URL constants to WooConstants
  Objective-C leaking into my brain. Removed parens around `if bool`
  Missed user defaults changes - default to user has not opted in to tracking
  Default to user has not opted in to analytics tracking.
  Remove optional for analytics provider (because it prevents unit testing)
  Add unit test for clearAllEvents()
  Touch up Tracks reporting for Settings
  Add logging
  Set up the interface to use the opt-out feature
  ...
@bummytime bummytime added feature: notifications Related to notifications or notifs. status: do not merge Dependent on another PR, ready for review but not ready for merge. labels Nov 1, 2018
@bummytime bummytime added this to the 0.10 milestone Nov 1, 2018
@bummytime bummytime self-assigned this Nov 1, 2018
@bummytime bummytime added this to MVLP Backlog in MVLP Kanban Board via automation Nov 1, 2018
@bummytime bummytime moved this from MVLP Backlog to Review/Testing in MVLP Kanban Board Nov 1, 2018
… issue/19-notifications-yosemite

* 'develop' of github.com:woocommerce/woocommerce-ios:
  Add env.example
  Add PRs list tool
  Updates Project
  NotificationsViewController: Wiring tabBar Initialization
  MainTabBarController: Removes unneeded setup
  Moving Notifications to its own Storyboard
  Implements Array+Notes
@bummytime bummytime removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Nov 2, 2018
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 2, 2018

2 Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.
⚠️ Core Data: Do not edit an existing model in a release branch unless it hasn’t been released to testers yet. Instead create a new model version and merge back to develop soon.

Generated by 🚫 Danger

Copy link
Collaborator

@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.

Few nipticky comments sir!! Feel free to merge once ready!!

Amazing work!!!!

:shipit:

Storage/Storage/CoreData/CoreDataManager.swift Outdated Show resolved Hide resolved
Networking/Networking/Network/MockupNetwork.swift Outdated Show resolved Hide resolved
Storage/Storage/CoreData/CoreDataManager.swift Outdated Show resolved Hide resolved
head = 0
}

return element
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: unless i'm missing something HUGE (which i probably am), wouldn't something like this work as well?

func dequeue() -> T? {
   return array.removeFirst()
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@jleandroperez Yeah it definitely would. This code is an optimized version of the Queue data struct which has better performance.

Storage/Storage/Model/Note+CoreDataProperties.swift Outdated Show resolved Hide resolved
Storage/Storage/CoreData/CoreDataManager.swift Outdated Show resolved Hide resolved
Yosemite/Yosemite/Stores/NotificationStore.swift Outdated Show resolved Hide resolved
Yosemite/YosemiteTests/Mockups/MockupStorage.swift Outdated Show resolved Hide resolved
@bummytime
Copy link
Member Author

Thanks for the review @jleandroperez !!

@bummytime bummytime merged commit 08281d0 into develop Nov 2, 2018
MVLP Kanban Board automation moved this from Review/Testing to Done/Merged Nov 2, 2018
@bummytime bummytime deleted the issue/19-notifications-yosemite branch November 2, 2018 19:06
@astralbodies astralbodies mentioned this pull request Nov 2, 2018
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: notifications Related to notifications or notifs.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants