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

Improve upload on background #10981

Merged
merged 11 commits into from
Feb 18, 2019
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
##
def wordpress_shared
## for production:
pod 'WordPressShared', '~> 1.7.1-beta.1'
pod 'WordPressShared', '1.7.1-beta.1'

## for development:
##pod 'WordPressShared', :path => '../WordPress-iOS-Shared'
Expand Down Expand Up @@ -94,8 +94,8 @@ target 'WordPress' do
## React Native
## =====================
##
pod 'Gutenberg', :git => 'http://github.com/wordpress-mobile/gutenberg-mobile/', :commit => '3aca8d421f234dc7d52790297619322454cdcb03'
pod 'RNTAztecView', :git => 'http://github.com/wordpress-mobile/gutenberg-mobile/', :commit => '3aca8d421f234dc7d52790297619322454cdcb03'
pod 'Gutenberg', :git => 'http://github.com/wordpress-mobile/gutenberg-mobile/', :commit => 'cf651e61a052513e85cc9e632451b01bb02519de'
pod 'RNTAztecView', :git => 'http://github.com/wordpress-mobile/gutenberg-mobile/', :commit => 'cf651e61a052513e85cc9e632451b01bb02519de'

gutenberg_pod 'React'
gutenberg_pod 'yoga'
Expand Down
20 changes: 10 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PODS:
- FormatterKit/TimeIntervalFormatter (1.8.2):
- FormatterKit/Resources
- Gifu (3.2.0)
- GiphyCoreSDK (1.4.0)
- GiphyCoreSDK (1.4.1)
- glog (0.3.4)
- GoogleSignInRepacked (4.1.2):
- "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
Expand Down Expand Up @@ -224,7 +224,7 @@ DEPENDENCIES:
- Gifu (= 3.2.0)
- GiphyCoreSDK (~> 1.4.0)
- Gridicons (~> 0.16)
- Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `3aca8d421f234dc7d52790297619322454cdcb03`)
- Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `cf651e61a052513e85cc9e632451b01bb02519de`)
- HockeySDK (= 5.1.4)
- MGSwipeTableCell (= 1.6.8)
- MRProgress (= 0.8.3)
Expand All @@ -239,14 +239,14 @@ DEPENDENCIES:
- react-native-keyboard-aware-scroll-view (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/develop/react-native-gutenberg-bridge/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json`)
- react-native-safe-area (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/react-native-safe-area.podspec.json`)
- RNSVG (from `https://github.com/wordpress-mobile/react-native-svg.git`, tag `8.0.9-gb.0`)
- RNTAztecView (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `3aca8d421f234dc7d52790297619322454cdcb03`)
- RNTAztecView (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `cf651e61a052513e85cc9e632451b01bb02519de`)
- SimulatorStatusMagic
- Starscream (= 3.0.6)
- SVProgressHUD (= 2.2.5)
- WordPress-Editor-iOS (= 1.4.2)
- WordPressAuthenticator (~> 1.1.9)
- WordPressKit (~> 2.1.0-beta.1)
- WordPressShared (~> 1.7.1-beta.1)
- WordPressShared (= 1.7.1-beta.1)
- WordPressUI (from `https://github.com/wordpress-mobile/WordPressUI-iOS.git`, tag `1.2.0`)
- WPMediaPicker (= 1.3.2)
- yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/yoga.podspec.json`)
Expand Down Expand Up @@ -299,7 +299,7 @@ EXTERNAL SOURCES:
Folly:
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/Folly.podspec.json
Gutenberg:
:commit: 3aca8d421f234dc7d52790297619322454cdcb03
:commit: cf651e61a052513e85cc9e632451b01bb02519de
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
React:
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/React.podspec.json
Expand All @@ -311,7 +311,7 @@ EXTERNAL SOURCES:
:git: https://github.com/wordpress-mobile/react-native-svg.git
:tag: 8.0.9-gb.0
RNTAztecView:
:commit: 3aca8d421f234dc7d52790297619322454cdcb03
:commit: cf651e61a052513e85cc9e632451b01bb02519de
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
WordPressUI:
:git: https://github.com/wordpress-mobile/WordPressUI-iOS.git
Expand All @@ -324,13 +324,13 @@ CHECKOUT OPTIONS:
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
:tag: 0.3.2-beta.1
Gutenberg:
:commit: 3aca8d421f234dc7d52790297619322454cdcb03
:commit: cf651e61a052513e85cc9e632451b01bb02519de
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
RNSVG:
:git: https://github.com/wordpress-mobile/react-native-svg.git
:tag: 8.0.9-gb.0
RNTAztecView:
:commit: 3aca8d421f234dc7d52790297619322454cdcb03
:commit: cf651e61a052513e85cc9e632451b01bb02519de
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
WordPressUI:
:git: https://github.com/wordpress-mobile/WordPressUI-iOS.git
Expand All @@ -349,7 +349,7 @@ SPEC CHECKSUMS:
Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
FormatterKit: 4b8f29acc9b872d5d12a63efb560661e8f2e1b98
Gifu: 7bcb6427457d85e0b4dff5a84ec5947ac19a93ea
GiphyCoreSDK: 1fe401c5fc65f182e7aa8b7fb2c9005f2a523374
GiphyCoreSDK: 147a492c2477e9ddb20f8dd3a4489e3ea3c05e38
glog: 1de0bb937dccdc981596d3b5825ebfb765017ded
GoogleSignInRepacked: d357702618c555f38923576924661325eb1ef22b
GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
Expand Down Expand Up @@ -385,6 +385,6 @@ SPEC CHECKSUMS:
yoga: f37b1edbd68be803f1dc4d57d40d8a5b277d8e2c
ZendeskSDK: 44ee00338dd718495f0364369420ae11b389c878

PODFILE CHECKSUM: fe153601e61dddf173575eca6614a4ea8d27291a
PODFILE CHECKSUM: 8139bd62216664f0615a2d43a6c9aeff7c2912f7

COCOAPODS: 1.5.3
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class GutenbergMediaInserterHelper: NSObject {
}
for media in post.media {
if media.remoteStatus == .failed {
gutenberg.mediaUploadUpdate(id: media.gutenbergUploadID, state: .uploading, progress: 0, url: media.absoluteThumbnailLocalURL, serverID: nil)
gutenberg.mediaUploadUpdate(id: media.gutenbergUploadID, state: .failed, progress: 0, url: nil, serverID: nil)
}
}
Expand Down Expand Up @@ -125,7 +126,8 @@ class GutenbergMediaInserterHelper: NSObject {
switch state {
case .processing:
gutenberg.mediaUploadUpdate(id: mediaUploadID, state: .uploading, progress: 0, url: nil, serverID: nil)
case .thumbnailReady:
case .thumbnailReady(let url):
gutenberg.mediaUploadUpdate(id: mediaUploadID, state: .uploading, progress: 0.20, url: url, serverID: nil)
break
case .uploading:
break
Expand Down
2 changes: 1 addition & 1 deletion WordPress/WordPressTest/DebouncerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DebouncerTests: XCTestCase {
///
func testDebouncerRunsNormally() {
let timerDelay = 0.5
let allowedError = 0.1
let allowedError = 0.2
let minDelay = timerDelay * (1 - allowedError)
let maxDelay = timerDelay * (1 + allowedError)
let testTimeout = maxDelay + 0.01
Expand Down