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

Issue/8020 xmlrpc api background uploads #8039

Merged
merged 35 commits into from
Oct 27, 2017

Conversation

SergioEstevao
Copy link
Contributor

Fixes #8020

Updates the XMLRPC Api to be able to use background uploads. In order to be able to do background uploads the class was refactored to use Alamofire.

To test:

  • Start the app
  • Connect to a XMLRPC site
  • Test the several parts of the app, Post, Media, Comments, Site Settings and see if works correctly
  • Test the same with an XMLRPC site with basic auth.

bummytime and others added 30 commits October 13, 2017 16:16
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS:
  Login: Fixes method signature after change.
  Activate swiftlint rule for wrapping conditional statements.
  Activate comma rule on Swiftlint and autocorrect code.
  Login: Connect a wpcom account to the google account.
  Login: Store the id_token in loginFields meta.
  Login: Pass client id and secret when making the call to connect.
  Login: Use enum for meta.socialService. Show correct instruction text on password screen.
  Login: Save email. Disconnect Google. Flag auth as social log in.
  Login: Handle a user_exists error. Show the password screen.
  Refactors error handling. Keep response obj via userInfo for failure blocks.
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS: (22 commits)
  Fix unrelated warning with Sergio’s permission
  Fix bad removal of parentheses.
  Fix swiftlint violation.
  Fix linting errors for control_statement.
  Make SwiftLint contro_statement an error instead of warning
  Remove whitespace.
  Make sure the bar button item has the correct dimension.
  Run rake lint:autocorrect.
  Removes some unnecessary unit tests. Removes Device.swift. Improves Build.swift.
  Removes Device.swift, which was unnecessary.
  PushNotificationsManager: Neutralizing Simulator Check
  InteractiveNotificationsManager: Neutralizing Simulator Check
  PushNotificationsManager: Fixing namespace collision
  FeatureFlag: New iCloudFilesSupport case
  Removes some really problematic whitespace.
  Renames a file that had an old name.
  Removes a commented line of code.
  Removes an unnecessary method.
  Removing trailing whitespace and an unnecessary file.
  Several fixes before submitting a PR.
  ...
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS:
  Add documentation for init method of the API.
  MediaLibrary: Fix search bar size / content inset on iOS 11
  Update Api code to allow setting of background uploads or not.
  Fix streak unit tests
  Refactor serialisation code to separate method.
  Ensure all posting activity loads
  Use background session for uploads of files.
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS:
  Media: Make creationDate nullable to match optional type in model.
  Enable previously disabled test
  Update Helpshift to version 6.3
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS:
  Posts/Pages: Fix more iOS 11 search layout issues.
  PostList: Update insets when presenting search controller (iOS 11 fixes)
  AbstractPostList: Fix area above search bar on iPhone X
  PostList: Fix search bar height on iOS 11.
  AbstractPostList: Fix up search bar scroll / content insets for iOS 11.
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS: (29 commits)
  Add clarifying comment about auth type length constants
  removed shared state between PostAttachmentTests
  Remove label duplication in Login2FAViewController
  Fix code hiding the SMS request button for social login
  Fix Typo
  extracted key 'alt' of ImageAttachment extraAttributes to variable
  Code style cleanup.
  minor code cosmetics
  removed obsolete header information
  fixed lint issues
  fixed lintin issues
  don't show alt tag, when alt string is empty
  adjusted unit test for adding alt value to tag.
  code format
  Do not show alt tag in img tag when no alt value was provided
  Added Unit Tests for Image Attachments
  added accessibility label to placeholderImage for ImageAttachment
  text formatting
  Edit alt tag after a posts image details
  Change the location where media status are changed.
  ...
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS: (28 commits)
  Updated bundle version
  Updated podfile
  Tab bar: Update icon and text colors
  Update Write tab bar icon to work correctly with template mode
  Update tab bar icons to use template rendering mode.
  Updates to Aztec 1.0.0-beta.13.
  Reset and reinstall in between screenshots
  Reduces the lineSpacing value slightly.
  AztecPostViewController: Preventing offsetY glitch
  Updated metadata
  Updated localizations
  Update Reader tab bar icon with latest version.
  align some let statements in LoginEmailViewController
  Fix crash when dismissing Google signin view
  Adds swiftlint corrections.
  Inegrates Aztec 1.0.0-beta.13 into WPiOS.
  Updated screenshot generation to new login and Aztec
  Added missing accessibility identifiers
  Updated screenshots generation configuration
  AztecPostViewController: Reverts unrelated constraint change
  ...

# Conflicts:
#	Podfile.lock
…PI_Background_uploads

# Conflicts:
#	Podfile.lock
#	WordPress/WordPress.xcodeproj/project.pbxproj
…nto feature/7972-WPCKit-migration

* 'develop' of github.com:wordpress-mobile/WordPress-iOS: (37 commits)
  Run rake lint:autocorrect.
  Removes some commented code.
  Fixes the unit tests.
  Updated apiBaseURLString to drop rest part
  Run: rake lint:autocorrect
  Enables Aztec by default. Simplifies editor settings.
  Turn on Google login for all builds
  AztecPostViewController: Updating title position upon mode switch
  Only enable comments on Jetpack sites locally
  PostAttachmentTests: Fixing build error
  Login: Removes unused analytic.
  Login: Bump no user stat.
  Cleanup minor issues in google login code
  Send correct responseDict to errorFor in WordPressComOAuthResponseSerializer
  Login: Some updates from code review.
  Login: Wires up analytic calls.
  Login: Adds new analytics keys for social login.
  Login: Setting constraints to reserve top and bottom padding.
  Fix behaviour of email field after Google login fails
  Removed a ! that Xcode was certain I needed earlier.
  ...
@bummytime
Copy link
Member

Nice work @SergioEstevao. So, I am in the middle of testing this now on both basic auth and no-auth .org sites. It is hard to quantify exactly, but everything in the app that requires a network connection seems to be a little "off". Examples of this include:

  • When uploading media in Aztec, the spinner/upload never completes
  • Cell images in the post list never appear (or take a really long time)
  • When viewing the item detail screen in the media library, the app locks up

...and a few other things. I am not sure if you have seen similar behavior or not but I wanted to mention it early.

@bummytime
Copy link
Member

bummytime commented Oct 25, 2017

@SergioEstevao those last two commits seemed to have fixed the issues. During testing I discovered #8053 and #8052, but these are unrelated to this PR.

Tested on .org site (no auth):
✅ New post (with device media uploaded & media lib inserted from picker)
✅ Edit post
✅ Post List
✅ Post Options (including Featured Image)
✅ Media Library - add media
✅ Media Library - delete media
✅ Comments
✅ Site Settings

Tested on .org site (basic auth):
✅ New post (with device media uploaded & media lib inserted from picker)
❌ Edit post — More or less worked but there were some issues. When opening a post with media the image placeholder in Aztec never updated:

screen shot 2017-10-25 at 12 52 11 pmscreen shot 2017-10-25 at 12 51 58 pm

❌ Post List — Refreshing worked, but "featured" image in post list cell did not display:

screen shot 2017-10-25 at 12 49 50 pm

❌ Post Options — More or less worked, but was unable to set featured image:

screen shot 2017-10-25 at 12 57 45 pm

✅ Media Library - add media
✅ Media Library - delete media
✅ Comments
✅ Site Settings

@bummytime
Copy link
Member

@frosty, maybe you could put some 👀 on this PR too to make sure I am not missing anything.

@bummytime
Copy link
Member

@SergioEstevao regarding the missing post list cell images and missing image placeholders above — this may be an existing issue with basic auth sites. I just tested develop and saw similar things happen. Let me know your thoughts.

@bummytime
Copy link
Member

Discussed in slack: all of the ❌ from above are separate issues and logged in #8054. Soooo beyond that, the code looks square and unit tests are 💚. I will say :shipit: from me nice work @SergioEstevao

@frosty
Copy link
Contributor

frosty commented Oct 26, 2017

@bummytime I agree for a change like this it'd be good to get a second set of eyes on it, particularly as it's introducing some big changes and a new pod. 👍 I'll see if I have time today, or we can ask someone else to take a look.

@SergioEstevao SergioEstevao merged commit a528d92 into develop Oct 27, 2017
@SergioEstevao SergioEstevao deleted the issue/8020_XMLRPC_API_Background_uploads branch October 27, 2017 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants