files.com 1.1.827 → 1.1.829
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -0
- data/_VERSION +1 -1
- data/doc/Files/APIConnectionError.html +1 -1
- data/doc/Files/APIError.html +1 -1
- data/doc/Files/AccountAlreadyExistsError.html +1 -1
- data/doc/Files/AccountLineItem.html +1 -1
- data/doc/Files/AccountOverdueError.html +1 -1
- data/doc/Files/Action.html +1 -1
- data/doc/Files/ActionLog.html +1 -1
- data/doc/Files/ActionNotificationExport.html +1 -1
- data/doc/Files/ActionNotificationExportResult.html +1 -1
- data/doc/Files/AdditionalAuthenticationRequiredError.html +1 -1
- data/doc/Files/AgentNode.html +1 -1
- data/doc/Files/AgentNodeConnection.html +1 -1
- data/doc/Files/AgentNodeInstance.html +1 -1
- data/doc/Files/AgentPushUpdate.html +1 -1
- data/doc/Files/AgentPushUpdateBlockedError.html +1 -1
- data/doc/Files/AgentUnavailableError.html +1 -1
- data/doc/Files/AgentUpgradeRequiredError.html +1 -1
- data/doc/Files/AiAssistantPersonality.html +1 -1
- data/doc/Files/AiTask.html +1 -1
- data/doc/Files/AiTaskCannotBeRunManuallyError.html +1 -1
- data/doc/Files/AlreadyCompletedError.html +1 -1
- data/doc/Files/Api.html +7 -5
- data/doc/Files/ApiClient/RequestLogContext.html +29 -29
- data/doc/Files/ApiClient/TransferSettings.html +29 -29
- data/doc/Files/ApiClient.html +210 -148
- data/doc/Files/ApiKey.html +1 -1
- data/doc/Files/ApiKeyIsDisabledError.html +1 -1
- data/doc/Files/ApiKeyIsPathRestrictedError.html +1 -1
- data/doc/Files/ApiKeyNotFoundError.html +1 -1
- data/doc/Files/ApiKeyOnlyForDesktopAppError.html +1 -1
- data/doc/Files/ApiKeyOnlyForFileOperationsError.html +1 -1
- data/doc/Files/ApiKeyOnlyForMobileAppError.html +1 -1
- data/doc/Files/ApiKeyOnlyForOfficeIntegrationError.html +1 -1
- data/doc/Files/ApiKeySessionsNotSupportedError.html +1 -1
- data/doc/Files/ApiRequestLog.html +1 -1
- data/doc/Files/App.html +1 -1
- data/doc/Files/As2IncomingMessage.html +1 -1
- data/doc/Files/As2OutgoingMessage.html +1 -1
- data/doc/Files/As2Partner.html +1 -1
- data/doc/Files/As2Station.html +1 -1
- data/doc/Files/AttachmentTooLargeError.html +1 -1
- data/doc/Files/AuthenticationError.html +1 -1
- data/doc/Files/AuthenticationRequiredError.html +1 -1
- data/doc/Files/Auto.html +1 -1
- data/doc/Files/Automation.html +1 -1
- data/doc/Files/AutomationAuthoringSchema.html +1 -1
- data/doc/Files/AutomationCannotBeRunManuallyError.html +1 -1
- data/doc/Files/AutomationExecutionNode.html +1 -1
- data/doc/Files/AutomationLog.html +1 -1
- data/doc/Files/AutomationRun.html +1 -1
- data/doc/Files/AutomationsUnavailableError.html +1 -1
- data/doc/Files/BadRequestError.html +1 -1
- data/doc/Files/BandwidthSnapshot.html +1 -1
- data/doc/Files/Behavior.html +1 -1
- data/doc/Files/BehaviorNotAllowedOnRemoteServerError.html +1 -1
- data/doc/Files/BillingInformationHiddenError.html +1 -1
- data/doc/Files/BillingPermissionRequiredError.html +1 -1
- data/doc/Files/BufferedUploadDisabledForThisDestinationError.html +1 -1
- data/doc/Files/Bundle.html +1 -1
- data/doc/Files/BundleAction.html +1 -1
- data/doc/Files/BundleDownload.html +1 -1
- data/doc/Files/BundleMaximumUsesReachedError.html +1 -1
- data/doc/Files/BundleNotification.html +1 -1
- data/doc/Files/BundleOnlyAllowsPreviewsError.html +1 -1
- data/doc/Files/BundleOperationRequiresSubfolderError.html +1 -1
- data/doc/Files/BundlePath.html +1 -1
- data/doc/Files/BundlePathNotFoundError.html +1 -1
- data/doc/Files/BundlePermissionRequiredError.html +1 -1
- data/doc/Files/BundleRecipient.html +1 -1
- data/doc/Files/BundleRegistration.html +1 -1
- data/doc/Files/BundleRegistrationCodeFailedError.html +1 -1
- data/doc/Files/BundleRegistrationNotFoundError.html +1 -1
- data/doc/Files/CannotAdministerHigherLevelUserError.html +1 -1
- data/doc/Files/CannotDownloadDirectoryError.html +1 -1
- data/doc/Files/CannotLoginWhileUsingKeyError.html +1 -1
- data/doc/Files/CantActForOtherUserError.html +1 -1
- data/doc/Files/CantMoveWithMultipleLocationsError.html +1 -1
- data/doc/Files/ChatMessage.html +1 -1
- data/doc/Files/ChatSession.html +1 -1
- data/doc/Files/ChildSiteManagementPolicy.html +1 -1
- data/doc/Files/Clickwrap.html +1 -1
- data/doc/Files/CodeNotFoundError.html +1 -1
- data/doc/Files/ConfigurationLockedPathError.html +1 -1
- data/doc/Files/ContactAdminForPasswordChangeHelpError.html +1 -1
- data/doc/Files/CouldNotCreateParentError.html +1 -1
- data/doc/Files/CustomDomain.html +1 -1
- data/doc/Files/DatetimeParseError.html +1 -1
- data/doc/Files/DesktopConfigurationProfile.html +1 -1
- data/doc/Files/DestinationExistsError.html +1 -1
- data/doc/Files/DestinationFolderLimitedError.html +1 -1
- data/doc/Files/DestinationParentConflictError.html +1 -1
- data/doc/Files/DestinationParentDoesNotExistError.html +1 -1
- data/doc/Files/DestinationSameError.html +1 -1
- data/doc/Files/DestinationSiteMismatchError.html +1 -1
- data/doc/Files/DirectConnectionInfo.html +1 -1
- data/doc/Files/DnsRecord.html +1 -1
- data/doc/Files/DoesNotSupportSortingError.html +1 -1
- data/doc/Files/DuplicateShareRecipientError.html +1 -1
- data/doc/Files/EmailIncomingMessage.html +1 -1
- data/doc/Files/EmailLog.html +1 -1
- data/doc/Files/Error.html +1 -1
- data/doc/Files/Errors.html +1 -1
- data/doc/Files/EventChannel.html +1 -1
- data/doc/Files/EventDeliveryAttempt.html +1 -1
- data/doc/Files/EventRecord.html +1 -1
- data/doc/Files/EventSubscription.html +1 -1
- data/doc/Files/EventTarget.html +1 -1
- data/doc/Files/ExavaultApiRequestLog.html +1 -1
- data/doc/Files/ExceededRuntimeLimitError.html +1 -1
- data/doc/Files/Expectation.html +1 -1
- data/doc/Files/ExpectationAlreadyHasOpenWindowError.html +1 -1
- data/doc/Files/ExpectationEvaluation.html +1 -1
- data/doc/Files/ExpectationIncident.html +1 -1
- data/doc/Files/ExpectationNotManualTriggerError.html +1 -1
- data/doc/Files/ExpiredPrivateKeyError.html +1 -1
- data/doc/Files/ExpiredPublicKeyError.html +1 -1
- data/doc/Files/ExportFailureError.html +1 -1
- data/doc/Files/ExportNotReadyError.html +1 -1
- data/doc/Files/ExternalEvent.html +1 -1
- data/doc/Files/FailedToChangePasswordError.html +1 -1
- data/doc/Files/File.html +1081 -1073
- data/doc/Files/FileAction.html +1 -1
- data/doc/Files/FileActionError.html +1 -1
- data/doc/Files/FileComment.html +1 -1
- data/doc/Files/FileCommentReaction.html +1 -1
- data/doc/Files/FileLockedError.html +1 -1
- data/doc/Files/FileMigration.html +1 -1
- data/doc/Files/FileMigrationLog.html +1 -1
- data/doc/Files/FileNotFoundError.html +1 -1
- data/doc/Files/FileNotUploadedError.html +1 -1
- data/doc/Files/FilePendingProcessingError.html +1 -1
- data/doc/Files/FileProcessingErrorError.html +1 -1
- data/doc/Files/FileTooBigToDecryptError.html +1 -1
- data/doc/Files/FileTooBigToEncryptError.html +1 -1
- data/doc/Files/FileUploadNotFoundError.html +1 -1
- data/doc/Files/FileUploadPart.html +1 -1
- data/doc/Files/FileUploadedToWrongRegionError.html +1 -1
- data/doc/Files/FileUtils.html +1 -1
- data/doc/Files/FilenameTooLongError.html +1 -1
- data/doc/Files/FilesAgentFailedAuthorizationError.html +1 -1
- data/doc/Files/FilesNativeStorageOverloadedError.html +1 -1
- data/doc/Files/Folder.html +1 -1
- data/doc/Files/FolderAdminOrBillingPermissionRequiredError.html +1 -1
- data/doc/Files/FolderAdminPermissionRequiredError.html +1 -1
- data/doc/Files/FolderLockedError.html +1 -1
- data/doc/Files/FolderMustNotBeAFileError.html +1 -1
- data/doc/Files/FolderNotEmptyError.html +1 -1
- data/doc/Files/FoldersNotAllowedError.html +1 -1
- data/doc/Files/FormField.html +1 -1
- data/doc/Files/FormFieldSet.html +1 -1
- data/doc/Files/FtpActionLog.html +1 -1
- data/doc/Files/FullPermissionRequiredError.html +1 -1
- data/doc/Files/GpgKey.html +1 -1
- data/doc/Files/Group.html +1 -1
- data/doc/Files/GroupNotFoundError.html +1 -1
- data/doc/Files/GroupUser.html +1 -1
- data/doc/Files/History.html +1 -1
- data/doc/Files/HistoryExport.html +1 -1
- data/doc/Files/HistoryExportResult.html +1 -1
- data/doc/Files/HistoryPermissionRequiredError.html +1 -1
- data/doc/Files/HistoryUnavailableError.html +1 -1
- data/doc/Files/HolidayCalendar.html +1 -1
- data/doc/Files/HolidayRegion.html +1 -1
- data/doc/Files/Image.html +1 -1
- data/doc/Files/InAppAiAssistantUnavailableError.html +1 -1
- data/doc/Files/InboundS3Log.html +1 -1
- data/doc/Files/InboxNotFoundError.html +1 -1
- data/doc/Files/InboxRecipient.html +1 -1
- data/doc/Files/InboxRegistration.html +1 -1
- data/doc/Files/InboxRegistrationCodeFailedError.html +1 -1
- data/doc/Files/InboxUpload.html +1 -1
- data/doc/Files/InsufficientPermissionForParamsError.html +1 -1
- data/doc/Files/InsufficientPermissionForSiteError.html +1 -1
- data/doc/Files/IntegrationCentricProfile.html +1 -1
- data/doc/Files/InternalGeneralErrorError.html +1 -1
- data/doc/Files/InvalidBodyError.html +1 -1
- data/doc/Files/InvalidBundleCodeError.html +1 -1
- data/doc/Files/InvalidCredentialsError.html +1 -1
- data/doc/Files/InvalidCursorError.html +1 -1
- data/doc/Files/InvalidCursorTypeForSortError.html +1 -1
- data/doc/Files/InvalidEtagsError.html +1 -1
- data/doc/Files/InvalidFileTypeError.html +1 -1
- data/doc/Files/InvalidFilenameError.html +1 -1
- data/doc/Files/InvalidFilterAliasCombinationError.html +1 -1
- data/doc/Files/InvalidFilterFieldError.html +1 -1
- data/doc/Files/InvalidFilterParamError.html +1 -1
- data/doc/Files/InvalidFilterParamFormatError.html +1 -1
- data/doc/Files/InvalidFilterParamValueError.html +1 -1
- data/doc/Files/InvalidInputEncodingError.html +1 -1
- data/doc/Files/InvalidInterfaceError.html +1 -1
- data/doc/Files/InvalidOauthError.html +1 -1
- data/doc/Files/InvalidOauthProviderError.html +1 -1
- data/doc/Files/InvalidOrExpiredCodeError.html +1 -1
- data/doc/Files/InvalidParameterError.html +1 -1
- data/doc/Files/InvalidPathError.html +1 -1
- data/doc/Files/InvalidPriorityColorError.html +1 -1
- data/doc/Files/InvalidRangeError.html +1 -1
- data/doc/Files/InvalidReturnToUrlError.html +1 -1
- data/doc/Files/InvalidSearchQueryError.html +1 -1
- data/doc/Files/InvalidSessionError.html +1 -1
- data/doc/Files/InvalidSiteError.html +1 -1
- data/doc/Files/InvalidSortFieldError.html +1 -1
- data/doc/Files/InvalidSortFilterCombinationError.html +1 -1
- data/doc/Files/InvalidUploadOffsetError.html +1 -1
- data/doc/Files/InvalidUploadPartGapError.html +1 -1
- data/doc/Files/InvalidUploadPartSizeError.html +1 -1
- data/doc/Files/InvalidUsernameOrPasswordError.html +1 -1
- data/doc/Files/InvalidWorkspaceIdHeaderError.html +1 -1
- data/doc/Files/InvalidZipFileError.html +1 -1
- data/doc/Files/Invoice.html +1 -1
- data/doc/Files/InvoiceLineItem.html +1 -1
- data/doc/Files/IpAddress.html +1 -1
- data/doc/Files/KeyLifecycleRule.html +1 -1
- data/doc/Files/List.html +1 -1
- data/doc/Files/Lock.html +1 -1
- data/doc/Files/LockOperationBusyError.html +1 -1
- data/doc/Files/LockedOutError.html +1 -1
- data/doc/Files/LockoutRegionMismatchError.html +1 -1
- data/doc/Files/MetadataCategory.html +1 -1
- data/doc/Files/MetadataNotSupportedOnRemotesError.html +1 -1
- data/doc/Files/MethodNotAllowedError.html +1 -1
- data/doc/Files/MigrationInProgressError.html +1 -1
- data/doc/Files/MissingParameterError.html +1 -1
- data/doc/Files/ModelSaveErrorError.html +1 -1
- data/doc/Files/MoverAccessDeniedError.html +1 -1
- data/doc/Files/MoverPackageRequiredError.html +1 -1
- data/doc/Files/MultipleProcessingErrorsError.html +1 -1
- data/doc/Files/MultipleSortParamsNotAllowedError.html +1 -1
- data/doc/Files/MustAuthenticateWithApiKeyError.html +1 -1
- data/doc/Files/NeedAdminPermissionForInboxError.html +1 -1
- data/doc/Files/NestedNotFoundError.html +1 -1
- data/doc/Files/NoAccountForSiteError.html +1 -1
- data/doc/Files/NoValidInputParamsError.html +1 -1
- data/doc/Files/NonAdminsMustQueryByFolderOrPathError.html +1 -1
- data/doc/Files/NotAllowedToCreateBundleError.html +1 -1
- data/doc/Files/NotAuthenticatedError.html +1 -1
- data/doc/Files/NotAuthorizedError.html +1 -1
- data/doc/Files/NotEnqueuableSyncError.html +1 -1
- data/doc/Files/NotFoundError.html +1 -1
- data/doc/Files/NotImplementedError.html +1 -1
- data/doc/Files/Notification.html +1 -1
- data/doc/Files/OffsetUploadNotAllowedWithMalwareScanningError.html +1 -1
- data/doc/Files/OneTimePasswordIncorrectError.html +1 -1
- data/doc/Files/OutboundConnectionLog.html +1 -1
- data/doc/Files/PartNumberTooLargeError.html +1 -1
- data/doc/Files/Partner.html +1 -1
- data/doc/Files/PartnerChannel.html +1 -1
- data/doc/Files/PartnerChannelTemplate.html +1 -1
- data/doc/Files/PartnerConnection.html +1 -1
- data/doc/Files/PartnerSite.html +1 -1
- data/doc/Files/PartnerSiteRequest.html +1 -1
- data/doc/Files/PasswordChangeNotRequiredError.html +1 -1
- data/doc/Files/PasswordChangeRequiredError.html +1 -1
- data/doc/Files/PathCannotHaveTrailingWhitespaceError.html +1 -1
- data/doc/Files/PathTooLongError.html +1 -1
- data/doc/Files/PathUtil.html +1 -1
- data/doc/Files/Payment.html +1 -1
- data/doc/Files/PaymentLineItem.html +1 -1
- data/doc/Files/PaymentMethodErrorError.html +1 -1
- data/doc/Files/PendingWorkEvent.html +1 -1
- data/doc/Files/Permission.html +1 -1
- data/doc/Files/PlanNotFoundError.html +1 -1
- data/doc/Files/Preview.html +1 -1
- data/doc/Files/PreviewOnlyPermissionCannotDownloadError.html +1 -1
- data/doc/Files/ProcessingFailureError.html +1 -1
- data/doc/Files/PublicHostingRequestLog.html +1 -1
- data/doc/Files/PublicIpAddress.html +1 -1
- data/doc/Files/PublicKey.html +1 -1
- data/doc/Files/RateLimitedError.html +1 -1
- data/doc/Files/ReadOnlySessionError.html +1 -1
- data/doc/Files/ReadPermissionRequiredError.html +1 -1
- data/doc/Files/ReauthenticationFailedError.html +1 -1
- data/doc/Files/ReauthenticationFailedFinalError.html +1 -1
- data/doc/Files/ReauthenticationNeededActionError.html +1 -1
- data/doc/Files/ReauthenticationNeededFieldsError.html +1 -1
- data/doc/Files/ReauthenticationRateLimitedError.html +1 -1
- data/doc/Files/RecaptchaFailedError.html +1 -1
- data/doc/Files/RecipientAlreadySharedError.html +1 -1
- data/doc/Files/RemoteBandwidthSnapshot.html +1 -1
- data/doc/Files/RemoteDesktopDebugLoggingDisabledError.html +1 -1
- data/doc/Files/RemoteEntryReadOnlyError.html +1 -1
- data/doc/Files/RemoteMountBackend.html +1 -1
- data/doc/Files/RemoteServer.html +1 -1
- data/doc/Files/RemoteServerConfigurationFile.html +1 -1
- data/doc/Files/RemoteServerCredential.html +1 -1
- data/doc/Files/RemoteServerErrorError.html +1 -1
- data/doc/Files/Request.html +1 -1
- data/doc/Files/RequestBodyTooLargeError.html +1 -1
- data/doc/Files/RequestParamsContainInvalidCharacterError.html +1 -1
- data/doc/Files/RequestParamsInvalidError.html +1 -1
- data/doc/Files/RequestParamsRequiredError.html +1 -1
- data/doc/Files/ResourceBelongsToParentSiteError.html +1 -1
- data/doc/Files/ResourceLockedError.html +1 -1
- data/doc/Files/Response.html +1 -1
- data/doc/Files/Restore.html +1 -1
- data/doc/Files/RootFolderBehaviorSiteAdminRequiredError.html +1 -1
- data/doc/Files/RootFolderBehaviorSkipSiteAdminRequiredError.html +1 -1
- data/doc/Files/Schedule.html +1 -1
- data/doc/Files/ScheduledExport.html +1 -1
- data/doc/Files/ScimLog.html +1 -1
- data/doc/Files/SearchAllOnChildPathError.html +1 -1
- data/doc/Files/SearchUnavailableError.html +1 -1
- data/doc/Files/Secret.html +1 -1
- data/doc/Files/SelfManagedRequiredError.html +1 -1
- data/doc/Files/ServiceUnavailableError.html +1 -1
- data/doc/Files/Session.html +1 -1
- data/doc/Files/SettingsChange.html +1 -1
- data/doc/Files/SftpActionLog.html +1 -1
- data/doc/Files/SftpHostKey.html +1 -1
- data/doc/Files/ShareGroup.html +1 -1
- data/doc/Files/ShareGroupMember.html +1 -1
- data/doc/Files/SiemHttpDestination.html +1 -1
- data/doc/Files/SiemHttpDestinationEvent.html +1 -1
- data/doc/Files/Site.html +1 -1
- data/doc/Files/SiteAdminOrPartnerAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminOrFolderAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminOrPartnerAdminOrFolderAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminOrPartnerAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminRequiredError.html +1 -1
- data/doc/Files/SiteConfigurationError.html +1 -1
- data/doc/Files/SiteDisabledError.html +1 -1
- data/doc/Files/SiteFilesAreImmutableError.html +1 -1
- data/doc/Files/SiteNotFoundError.html +1 -1
- data/doc/Files/SiteSubdomainRedirect.html +1 -1
- data/doc/Files/SiteWasRemovedError.html +1 -1
- data/doc/Files/SizableIO.html +1 -1
- data/doc/Files/Snapshot.html +1 -1
- data/doc/Files/SsoEvent.html +1 -1
- data/doc/Files/SsoStrategy.html +1 -1
- data/doc/Files/Status.html +1 -1
- data/doc/Files/Style.html +1 -1
- data/doc/Files/SubfolderLockedError.html +1 -1
- data/doc/Files/Sync.html +1 -1
- data/doc/Files/SyncInProgressError.html +1 -1
- data/doc/Files/SyncLog.html +1 -1
- data/doc/Files/SyncRun.html +1 -1
- data/doc/Files/SyncRunLiveTransfer.html +1 -1
- data/doc/Files/SystemProfiler.html +1 -1
- data/doc/Files/TooManyConcurrentLoginsError.html +1 -1
- data/doc/Files/TooManyConcurrentRequestsError.html +1 -1
- data/doc/Files/TooManyLoginAttemptsError.html +1 -1
- data/doc/Files/TooManyRequestsError.html +1 -1
- data/doc/Files/TooManySharesError.html +1 -1
- data/doc/Files/Transfer/Attempts.html +88 -18
- data/doc/Files/Transfer/BufferLimitError.html +1 -1
- data/doc/Files/Transfer/ByteBudget/Reservation.html +1 -1
- data/doc/Files/Transfer/ByteBudget.html +1 -1
- data/doc/Files/Transfer/CancelledError.html +1 -1
- data/doc/Files/Transfer/Checkpoint.html +1 -1
- data/doc/Files/Transfer/CheckpointError.html +1 -1
- data/doc/Files/Transfer/ClientTransport/ClientResponse.html +36 -36
- data/doc/Files/Transfer/ClientTransport/Reader.html +33 -29
- data/doc/Files/Transfer/ClientTransport.html +34 -34
- data/doc/Files/Transfer/Clock.html +1 -1
- data/doc/Files/Transfer/Control.html +1 -1
- data/doc/Files/Transfer/Controller/Attempt.html +1 -1
- data/doc/Files/Transfer/Controller.html +1 -1
- data/doc/Files/Transfer/Coordinator/Timing.html +1 -1
- data/doc/Files/Transfer/Coordinator.html +1 -1
- data/doc/Files/Transfer/DownloadCoordinator/FileSink.html +134 -60
- data/doc/Files/Transfer/DownloadCoordinator/IoSink.html +152 -77
- data/doc/Files/Transfer/DownloadCoordinator/Piece.html +37 -37
- data/doc/Files/Transfer/DownloadCoordinator.html +85 -70
- data/doc/Files/Transfer/DownloadDate.html +467 -0
- data/doc/Files/Transfer/FileSlots.html +1 -1
- data/doc/Files/Transfer/FrontendResponseError.html +1 -1
- data/doc/Files/Transfer/Holds.html +1 -1
- data/doc/Files/Transfer/HttpTransport.html +13 -12
- data/doc/Files/Transfer/Job.html +1 -1
- data/doc/Files/Transfer/Options.html +1 -1
- data/doc/Files/Transfer/PausedError.html +1 -1
- data/doc/Files/Transfer/Policy.html +1 -1
- data/doc/Files/Transfer/RequestPermits.html +1 -1
- data/doc/Files/Transfer/SourceChangedError.html +1 -1
- data/doc/Files/Transfer/StorageResponse.html +1 -1
- data/doc/Files/Transfer/StorageRetry.html +259 -102
- data/doc/Files/Transfer/UploadCoordinator/Grant.html +1 -1
- data/doc/Files/Transfer/UploadCoordinator/Part.html +1 -1
- data/doc/Files/Transfer/UploadCoordinator/Region.html +1 -1
- data/doc/Files/Transfer/UploadCoordinator/Segments.html +1 -1
- data/doc/Files/Transfer/UploadCoordinator/Source.html +1 -1
- data/doc/Files/Transfer/UploadCoordinator/StreamSource.html +1 -1
- data/doc/Files/Transfer/UploadCoordinator.html +1 -1
- data/doc/Files/Transfer/UploadPlan.html +1 -1
- data/doc/Files/Transfer/UrlExpired.html +1 -1
- data/doc/Files/Transfer/VersionChangedError.html +1 -1
- data/doc/Files/Transfer.html +3 -3
- data/doc/Files/TrialExpiredError.html +1 -1
- data/doc/Files/TrialLockedError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationCodeAlreadySentError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationCountryBlacklistedError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationErrorError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationGeneralErrorError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationMethodUnsupportedErrorError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationRequiredError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationSetupExpiredError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationUnsubscribedRecipientError.html +1 -1
- data/doc/Files/URI.html +1 -1
- data/doc/Files/UnrecognizedSortIndexError.html +1 -1
- data/doc/Files/UnsupportedCurrencyError.html +1 -1
- data/doc/Files/UnsupportedHttpResponseFormatError.html +1 -1
- data/doc/Files/UnsupportedMediaTypeError.html +1 -1
- data/doc/Files/UpdatesNotAllowedForRemotesError.html +1 -1
- data/doc/Files/UploadFinalization.html +1 -1
- data/doc/Files/UploadsUnavailableError.html +1 -1
- data/doc/Files/UsageByTopLevelDir.html +1 -1
- data/doc/Files/UsageDailySnapshot.html +1 -1
- data/doc/Files/UsageSnapshot.html +1 -1
- data/doc/Files/User.html +1 -1
- data/doc/Files/UserAdditionalEmailRecipient.html +1 -1
- data/doc/Files/UserCipherUse.html +1 -1
- data/doc/Files/UserIdInvalidError.html +1 -1
- data/doc/Files/UserIdOnUserEndpointError.html +1 -1
- data/doc/Files/UserIdWithoutSiteAdminError.html +1 -1
- data/doc/Files/UserLifecycleRule.html +1 -1
- data/doc/Files/UserNotFoundError.html +1 -1
- data/doc/Files/UserRequest.html +1 -1
- data/doc/Files/UserRequestsEnabledRequiredError.html +1 -1
- data/doc/Files/UserRequiredError.html +1 -1
- data/doc/Files/UserSecurityEvent.html +1 -1
- data/doc/Files/UserSftpClientUse.html +1 -1
- data/doc/Files/Util/LogSettings.html +1 -1
- data/doc/Files/Util.html +1 -1
- data/doc/Files/WebDavActionLog.html +1 -1
- data/doc/Files/WebhookTest.html +1 -1
- data/doc/Files/Workspace.html +1 -1
- data/doc/Files/WriteAndBundlePermissionRequiredError.html +1 -1
- data/doc/Files/WritePermissionRequiredError.html +1 -1
- data/doc/Files/ZipListEntry.html +1 -1
- data/doc/Files.html +167 -101
- data/doc/_index.html +8 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +11 -2
- data/doc/index.html +11 -2
- data/doc/method_list.html +2815 -2727
- data/doc/top-level-namespace.html +1 -1
- data/docs/file.md +21 -5
- data/lib/files.com/api.rb +1 -0
- data/lib/files.com/api_client.rb +23 -2
- data/lib/files.com/models/file.rb +11 -7
- data/lib/files.com/transfer/attempts.rb +3 -2
- data/lib/files.com/transfer/download_coordinator.rb +104 -16
- data/lib/files.com/transfer/download_date.rb +44 -0
- data/lib/files.com/transfer/http_transport.rb +14 -9
- data/lib/files.com/transfer/storage_retry.rb +22 -4
- data/lib/files.com.rb +3 -0
- data/spec/models/native_file_spec.rb +4 -2
- data/spec/transfer/adaptive_download_spec.rb +335 -4
- metadata +3 -1
|
@@ -24,15 +24,17 @@ RSpec.describe Files::File, "native helpers" do
|
|
|
24
24
|
allow(Files::ApiClient).to receive(:default_conn).and_return(stubbed_api_client.conn)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
# A class call without a client makes the thread's default API client, which the thread keeps, from the stubbed
|
|
28
|
+
# default_conn: it is put back as it was, so later examples never send through these stubs.
|
|
27
29
|
around do |example|
|
|
28
|
-
previous = [ Files.api_key, Files.max_network_retries, Thread.current[:files_api_client] ]
|
|
30
|
+
previous = [ Files.api_key, Files.max_network_retries, Thread.current[:files_api_client], Thread.current[:files_api_client_default_client] ]
|
|
29
31
|
Files.api_key = "native-helper-fixture-key"
|
|
30
32
|
Files.max_network_retries = 0
|
|
31
33
|
example.run
|
|
32
34
|
ensure
|
|
33
35
|
gate.close
|
|
34
36
|
servers.each(&:close)
|
|
35
|
-
Files.api_key, Files.max_network_retries, Thread.current[:files_api_client] = previous
|
|
37
|
+
Files.api_key, Files.max_network_retries, Thread.current[:files_api_client], Thread.current[:files_api_client_default_client] = previous
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
def active_client(client)
|
|
@@ -51,10 +51,13 @@ RSpec.describe Files::File, "adaptive downloads" do
|
|
|
51
51
|
TransferServer.response("206 Partial Content", { "ETag" => etag, "Content-Range" => "bytes #{first}-#{last}/#{content.bytesize}", "Content-Length" => body.bytesize }, body)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# The API, made Files.base_url, answering each file lookup with a download URL on store
|
|
55
|
-
|
|
54
|
+
# The API, made Files.base_url, answering each file lookup with a download URL on store, or on the store it returns
|
|
55
|
+
# when it is a callable, after calling on_lookup when given.
|
|
56
|
+
def api_server(store, on_lookup: nil)
|
|
56
57
|
api = TransferServer.new(concurrent: true) do |_request|
|
|
57
|
-
|
|
58
|
+
on_lookup&.call
|
|
59
|
+
target = store.respond_to?(:call) ? store.call : store
|
|
60
|
+
body = JSON.generate(path: "report.bin", type: "file", download_uri: target.url("/objects/report.bin"))
|
|
58
61
|
TransferServer.response("200 OK", { "Content-Type" => "application/json", "Content-Length" => body.bytesize }, body)
|
|
59
62
|
end
|
|
60
63
|
servers << api
|
|
@@ -103,7 +106,7 @@ RSpec.describe Files::File, "adaptive downloads" do
|
|
|
103
106
|
it "stops with VersionChangedError when storage no longer has the version, keeping what was written and closing the IO" do
|
|
104
107
|
store = storage_server(answer: ->(request, default) { request.headers["if-match"] ? TransferServer.response("412 Precondition Failed", { "Content-Length" => 0 }) : default })
|
|
105
108
|
|
|
106
|
-
expect { remote_file(store).download_content(sink, transfer: transfer) }.to raise_error(Files::Transfer::VersionChangedError)
|
|
109
|
+
expect { remote_file(store).download_content(sink, transfer: transfer, check_download_modification_time: false) }.to raise_error(Files::Transfer::VersionChangedError)
|
|
107
110
|
expect(sink.string).to eq(payload.byteslice(0, 65_536))
|
|
108
111
|
expect(sink).to be_closed
|
|
109
112
|
end
|
|
@@ -664,6 +667,121 @@ RSpec.describe Files::File, "adaptive downloads" do
|
|
|
664
667
|
end
|
|
665
668
|
|
|
666
669
|
describe "without a bound version" do
|
|
670
|
+
it "keeps its disabled snapshot through a global change and does not send the local setting as an API header" do
|
|
671
|
+
original = Files.check_download_modification_time
|
|
672
|
+
Files.check_download_modification_time = false
|
|
673
|
+
Files.max_network_retries = 1
|
|
674
|
+
baseline = "Wed, 21 Oct 2015 07:28:00 GMT"
|
|
675
|
+
store = storage_server(answer: lambda { |_request, _default|
|
|
676
|
+
first = store.requests.size == 1
|
|
677
|
+
Files.check_download_modification_time = true
|
|
678
|
+
modified = first ? baseline : "Wed, 21 Oct 2015 07:28:01 GMT"
|
|
679
|
+
TransferServer.response("200 OK", { "Content-Length" => payload.bytesize, "Last-Modified" => modified }, first ? payload.byteslice(0, 4096) : payload)
|
|
680
|
+
}
|
|
681
|
+
)
|
|
682
|
+
api = api_server(store)
|
|
683
|
+
Dir.mktmpdir do |dir|
|
|
684
|
+
remote = described_class.new({ path: "report.bin" }, { check_download_modification_time: false })
|
|
685
|
+
local = File.join(dir, "snapshot.bin")
|
|
686
|
+
remote.download_file(local, transfer: transfer)
|
|
687
|
+
expect(File.binread(local)).to eq(payload)
|
|
688
|
+
end
|
|
689
|
+
expect(store.requests.map { |request| request.headers["if-unmodified-since"] }).to eq([ nil, nil ])
|
|
690
|
+
expect(api.requests).not_to be_empty
|
|
691
|
+
expect(api.requests).to all(satisfy { |request| !request.headers.key?("check_download_modification_time") })
|
|
692
|
+
ensure
|
|
693
|
+
Files.check_download_modification_time = original
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
[ [ false, nil ], [ true, false ], [ false, true ] ].each do |client_check, local_check|
|
|
697
|
+
it "resolves client and local timestamp checks once (#{client_check}, #{local_check.inspect})" do
|
|
698
|
+
baseline = "Wed, 21 Oct 2015 07:28:00 GMT"
|
|
699
|
+
newer = "Wed, 21 Oct 2015 07:28:01 GMT"
|
|
700
|
+
store = storage_server(etag: "W/\"v1\"", answer: lambda { |_request, default|
|
|
701
|
+
modified = store.requests.size == 1 ? baseline : newer
|
|
702
|
+
default.sub("\r\n", "\r\nLast-Modified: #{modified}\r\n")
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
client = Files::ApiClient.new(check_download_modification_time: client_check)
|
|
706
|
+
remote = described_class.new({ path: "report.bin", download_uri: store.url("/objects/report.bin") }, { client: client })
|
|
707
|
+
guarded = local_check.nil? ? client_check : local_check
|
|
708
|
+
download = -> { remote.download_content(sink, transfer: transfer, check_download_modification_time: local_check) }
|
|
709
|
+
if guarded
|
|
710
|
+
expect(&download).to raise_error(Files::Transfer::VersionChangedError)
|
|
711
|
+
else
|
|
712
|
+
download.call
|
|
713
|
+
expect(sink.string).to eq(payload)
|
|
714
|
+
end
|
|
715
|
+
expect(store.requests.map { |request| request.headers["if-unmodified-since"] }).to eq([ nil, guarded ? baseline : nil ])
|
|
716
|
+
end
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
[ "Wed, 21 Oct 2015 07:28:00 GMT", "invalid date", nil ].each do |modified|
|
|
720
|
+
it "uses one valid Last-Modified for the fallback without binding ranges (#{modified.inspect})" do
|
|
721
|
+
store = storage_server(etag: "W/\"v1\"", answer: lambda { |_request, default|
|
|
722
|
+
modified ? default.sub("\r\n", "\r\nLast-Modified: #{modified}\r\n") : default
|
|
723
|
+
}
|
|
724
|
+
)
|
|
725
|
+
remote_file(store).download_content(sink, transfer: transfer)
|
|
726
|
+
expect(sink.string).to eq(payload)
|
|
727
|
+
expect(ranges(store)).to eq([ "bytes=0-65535", nil ])
|
|
728
|
+
expected = modified&.start_with?("Wed,") ? modified : nil
|
|
729
|
+
expect(store.requests.map { |request| request.headers["if-unmodified-since"] }).to eq([ nil, expected ])
|
|
730
|
+
end
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
[ false, true ].each do |ignored|
|
|
734
|
+
it "refuses a newer date before fallback bytes are written, conditional ignored=#{ignored}" do
|
|
735
|
+
baseline = "Wed, 21 Oct 2015 07:28:00 GMT"
|
|
736
|
+
newer = "Wed, 21 Oct 2015 07:28:01 GMT"
|
|
737
|
+
store = storage_server(etag: "W/\"v1\"", answer: lambda { |request, default|
|
|
738
|
+
if store.requests.size == 1
|
|
739
|
+
default.sub("\r\n", "\r\nLast-Modified: #{baseline}\r\n")
|
|
740
|
+
elsif !ignored && request.headers["if-unmodified-since"] == baseline
|
|
741
|
+
TransferServer.response("412 Precondition Failed", { "Content-Length" => 0 })
|
|
742
|
+
else
|
|
743
|
+
default.sub("\r\n", "\r\nLast-Modified: #{newer}\r\n")
|
|
744
|
+
end
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
expect { remote_file(store).download_content(sink, transfer: transfer) }.to raise_error(Files::Transfer::VersionChangedError)
|
|
748
|
+
expect(sink.string).to be_empty
|
|
749
|
+
expect(store.requests.map { |request| request.headers["if-unmodified-since"] }).to eq([ nil, baseline ])
|
|
750
|
+
end
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
it "retains its date through a short response, retry and URL renewal" do
|
|
754
|
+
Files.max_network_retries = 2
|
|
755
|
+
baseline = "Wed, 21 Oct 2015 07:28:00 GMT"
|
|
756
|
+
store = storage_server(answer: lambda { |_request, _default|
|
|
757
|
+
count = store.requests.size
|
|
758
|
+
if count == 2
|
|
759
|
+
TransferServer.response("403 Forbidden", { "Content-Length" => 34 }, "<Error>Request has expired</Error>")
|
|
760
|
+
else
|
|
761
|
+
TransferServer.response("200 OK", { "Content-Length" => payload.bytesize, "Last-Modified" => baseline }, count == 1 ? payload.byteslice(0, 4096) : payload)
|
|
762
|
+
end
|
|
763
|
+
}
|
|
764
|
+
)
|
|
765
|
+
api_server(store)
|
|
766
|
+
Dir.mktmpdir do |dir|
|
|
767
|
+
local = File.join(dir, "date.bin")
|
|
768
|
+
remote_file(store).download_file(local, transfer: transfer)
|
|
769
|
+
expect(File.binread(local)).to eq(payload)
|
|
770
|
+
end
|
|
771
|
+
expect(store.requests.map { |request| request.headers["if-unmodified-since"] }).to eq([ nil, baseline, baseline ])
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
it "keeps If-Match precedence when later ranges declare newer dates" do
|
|
775
|
+
store = storage_server(answer: lambda { |request, default|
|
|
776
|
+
modified = request.headers["if-match"] ? "Wed, 21 Oct 2015 07:28:01 GMT" : "Wed, 21 Oct 2015 07:28:00 GMT"
|
|
777
|
+
default.sub("\r\n", "\r\nLast-Modified: #{modified}\r\n")
|
|
778
|
+
}
|
|
779
|
+
)
|
|
780
|
+
remote_file(store).download_content(sink, transfer: transfer)
|
|
781
|
+
expect(sink.string).to eq(payload)
|
|
782
|
+
expect(store.requests.drop(1)).to all(satisfy { |request| request.headers["if-match"] == "\"v1\"" && !request.headers.key?("if-unmodified-since") })
|
|
783
|
+
end
|
|
784
|
+
|
|
667
785
|
it "streams the whole response once when the opening range has a weak ETag" do
|
|
668
786
|
store = storage_server(etag: "W/\"v1\"")
|
|
669
787
|
|
|
@@ -764,6 +882,187 @@ RSpec.describe Files::File, "adaptive downloads" do
|
|
|
764
882
|
end
|
|
765
883
|
end
|
|
766
884
|
|
|
885
|
+
# The file as it is after the change: five full 64 KiB ranges and a short one, fewer bytes than before.
|
|
886
|
+
describe "a remote file that changes" do
|
|
887
|
+
let(:changed) { Random.new(9).bytes((5 * 65_536) + 123) }
|
|
888
|
+
let(:refused) { TransferServer.response("412 Precondition Failed", { "Content-Length" => 0 }) }
|
|
889
|
+
|
|
890
|
+
# Ranges after the opening one are refused as another version, with responses (default ones when nil).
|
|
891
|
+
def refusing_ranges(response = nil)
|
|
892
|
+
storage_server(answer: ->(request, default) { request.headers["if-match"] ? (response || refused) : default })
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
def conflict(type, body)
|
|
896
|
+
TransferServer.response("409 Conflict", { "Content-Type" => type, "Content-Length" => body.bytesize }, body)
|
|
897
|
+
end
|
|
898
|
+
|
|
899
|
+
# Four ranges of the old version are in flight when one of them is refused. A sibling's answer, its range body or
|
|
900
|
+
# the body of a 500, trickles in 256 bytes at a time, seconds from its end: its read stops at its next chunk, so the
|
|
901
|
+
# restart, which joins every request of the attempt first, asks for the new URL while that body is still unfinished.
|
|
902
|
+
# Nothing of the old version, its bytes or its date, reaches the new file.
|
|
903
|
+
{ "206 range body" => nil, "500 error body" => "500 Internal Server Error" }.each do |label, error_status|
|
|
904
|
+
it "stops an obsolete #{label} still arriving, joins the attempt's requests, then starts a local file over with a new URL, size, version and date" do
|
|
905
|
+
Files.max_network_retries = 2
|
|
906
|
+
lock = Mutex.new
|
|
907
|
+
trickle = { started: false, finished: false }
|
|
908
|
+
finished_at_lookup = []
|
|
909
|
+
dated = ->(response, modified) { response.sub("\r\n", "\r\nLast-Modified: #{modified}\r\n") }
|
|
910
|
+
old = storage_server(answer: lambda { |request, default|
|
|
911
|
+
next dated.call(default, "Wed, 21 Oct 2015 07:28:00 GMT") unless request.headers["if-match"]
|
|
912
|
+
|
|
913
|
+
case request.headers["range"]
|
|
914
|
+
when "bytes=65536-131071"
|
|
915
|
+
wait_until { lock.synchronize { trickle[:started] } }
|
|
916
|
+
refused
|
|
917
|
+
when "bytes=131072-196607"
|
|
918
|
+
head, body = if error_status
|
|
919
|
+
[ TransferServer.response(error_status, { "Content-Length" => 65_536 }).delete_suffix("\r\n\r\n"), ("e" * 65_536).b ]
|
|
920
|
+
else
|
|
921
|
+
default.split("\r\n\r\n", 2)
|
|
922
|
+
end
|
|
923
|
+
pieces = (0...body.bytesize).step(256).map { |offset| body.byteslice(offset, 256) }
|
|
924
|
+
[ "#{head}\r\n\r\n#{pieces.shift}", -> { lock.synchronize { trickle[:started] = true } },
|
|
925
|
+
*pieces.flat_map { |piece| [ -> { sleep 0.02 }, piece ] }, -> { lock.synchronize { trickle[:finished] = true } } ]
|
|
926
|
+
else
|
|
927
|
+
default
|
|
928
|
+
end
|
|
929
|
+
}
|
|
930
|
+
)
|
|
931
|
+
store = storage_server(changed, etag: "\"v2\"", answer: ->(_request, default) { dated.call(default, "Wed, 21 Oct 2015 07:28:01 GMT") })
|
|
932
|
+
api_server(store, on_lookup: -> { lock.synchronize { finished_at_lookup << trickle[:finished] } })
|
|
933
|
+
|
|
934
|
+
Files::Transfer::Job.open(**transfer, concurrency: 4) do |job|
|
|
935
|
+
Dir.mktmpdir do |dir|
|
|
936
|
+
local_path = File.join(dir, "report.bin")
|
|
937
|
+
remote_file(old).download_file(local_path, transfer: job)
|
|
938
|
+
expect(File.binread(local_path)).to eq(changed)
|
|
939
|
+
end
|
|
940
|
+
expect(job.diagnostics.values_at(:retries, :held_bytes, :requests)).to eq([ 1, 0, 0 ])
|
|
941
|
+
end
|
|
942
|
+
|
|
943
|
+
expect(finished_at_lookup).to eq([ false ])
|
|
944
|
+
expect(old.requests.size).to eq(5)
|
|
945
|
+
expect(store.requests.first.headers.values_at("range", "if-match", "if-unmodified-since")).to eq([ "bytes=0-65535", nil, nil ])
|
|
946
|
+
expect(store.requests.drop(1).map { |request| request.headers["if-match"] }.uniq).to eq([ "\"v2\"" ])
|
|
947
|
+
end
|
|
948
|
+
end
|
|
949
|
+
|
|
950
|
+
[ 0, 2 ].each do |retries|
|
|
951
|
+
it "raises VersionChangedError after exactly #{retries} restarts when the file has changed again on every attempt" do
|
|
952
|
+
Files.max_network_retries = retries
|
|
953
|
+
store = refusing_ranges
|
|
954
|
+
api = api_server(store)
|
|
955
|
+
|
|
956
|
+
Files::Transfer::Job.open(**transfer) do |job|
|
|
957
|
+
Dir.mktmpdir do |dir|
|
|
958
|
+
# Each attempt writes its opening range before it finds the change, and still counts.
|
|
959
|
+
expect { described_class.new(path: "report.bin").download_file(File.join(dir, "report.bin"), transfer: job) }
|
|
960
|
+
.to raise_error(Files::Transfer::VersionChangedError)
|
|
961
|
+
end
|
|
962
|
+
expect(job.diagnostics[:retries]).to eq(retries)
|
|
963
|
+
end
|
|
964
|
+
expect(api.requests.size).to eq(retries + 1)
|
|
965
|
+
expect(ranges(store).count("bytes=0-65535")).to eq(retries + 1)
|
|
966
|
+
end
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
it "starts over on storage's 409 download_source_changed, for an opening request into an IO not yet written to and for a range of a local file" do
|
|
970
|
+
Files.max_network_retries = 1
|
|
971
|
+
typed = conflict("application/json", JSON.generate(type: "download_source_changed", error: "The source file changed while it was being downloaded.", 'http-code': 409))
|
|
972
|
+
|
|
973
|
+
old = storage_server(answer: ->(_request, _default) { typed })
|
|
974
|
+
api = api_server(storage_server(changed, etag: "\"v2\""))
|
|
975
|
+
remote_file(old).download_content(sink, transfer: transfer)
|
|
976
|
+
expect(sink.string).to eq(changed)
|
|
977
|
+
expect([ old.requests.size, api.requests.size ]).to eq([ 1, 1 ])
|
|
978
|
+
|
|
979
|
+
old = refusing_ranges(typed)
|
|
980
|
+
api = api_server(storage_server(changed, etag: "\"v2\""))
|
|
981
|
+
Dir.mktmpdir do |dir|
|
|
982
|
+
local_path = File.join(dir, "report.bin")
|
|
983
|
+
remote_file(old).download_file(local_path, transfer: transfer)
|
|
984
|
+
expect(File.binread(local_path)).to eq(changed)
|
|
985
|
+
end
|
|
986
|
+
expect(api.requests.size).to eq(1)
|
|
987
|
+
end
|
|
988
|
+
|
|
989
|
+
it "fails on any other 409 without asking for a new URL" do
|
|
990
|
+
Files.max_network_retries = 2
|
|
991
|
+
[
|
|
992
|
+
conflict("application/json", JSON.generate(type: "processing-failure/conflict", error: "download_source_changed mentioned in another error", 'http-code': 409)),
|
|
993
|
+
conflict("text/plain", "download_source_changed")
|
|
994
|
+
].each do |other|
|
|
995
|
+
store = refusing_ranges(other)
|
|
996
|
+
api = api_server(store)
|
|
997
|
+
Dir.mktmpdir do |dir|
|
|
998
|
+
expect { remote_file(store).download_file(File.join(dir, "report.bin"), transfer: transfer) }
|
|
999
|
+
.to raise_error(Files::APIError, "Transfer request failed") { |error| expect(error.http_status).to eq(409) }
|
|
1000
|
+
end
|
|
1001
|
+
expect(api.requests).to be_empty
|
|
1002
|
+
end
|
|
1003
|
+
end
|
|
1004
|
+
|
|
1005
|
+
it "starts over with the newer date as its baseline when storage ignores If-Unmodified-Since and answers a newer Last-Modified" do
|
|
1006
|
+
Files.max_network_retries = 1
|
|
1007
|
+
baseline = "Wed, 21 Oct 2015 07:28:00 GMT"
|
|
1008
|
+
newer = "Wed, 21 Oct 2015 07:28:01 GMT"
|
|
1009
|
+
store = storage_server(answer: lambda { |request, _default|
|
|
1010
|
+
content, modified = store.requests.size == 1 ? [ payload, baseline ] : [ changed, newer ]
|
|
1011
|
+
stored(content, request.headers["range"], "W/\"v1\"").sub("\r\n", "\r\nLast-Modified: #{modified}\r\n")
|
|
1012
|
+
}
|
|
1013
|
+
)
|
|
1014
|
+
api = api_server(store)
|
|
1015
|
+
|
|
1016
|
+
Dir.mktmpdir do |dir|
|
|
1017
|
+
local_path = File.join(dir, "report.bin")
|
|
1018
|
+
remote_file(store).download_file(local_path, transfer: transfer)
|
|
1019
|
+
expect(File.binread(local_path)).to eq(changed)
|
|
1020
|
+
end
|
|
1021
|
+
expect(store.requests.map { |request| request.headers.values_at("range", "if-unmodified-since") })
|
|
1022
|
+
.to eq([ [ "bytes=0-65535", nil ], [ nil, baseline ], [ "bytes=0-65535", nil ], [ nil, newer ] ])
|
|
1023
|
+
expect(api.requests.size).to eq(1)
|
|
1024
|
+
end
|
|
1025
|
+
|
|
1026
|
+
it "raises instead of starting over an IO it has written to, and closes it" do
|
|
1027
|
+
Files.max_network_retries = 2
|
|
1028
|
+
store = refusing_ranges
|
|
1029
|
+
api = api_server(store)
|
|
1030
|
+
|
|
1031
|
+
expect { remote_file(store).download_content(sink, transfer: transfer) }.to raise_error(Files::Transfer::VersionChangedError)
|
|
1032
|
+
expect(sink.string).to eq(payload.byteslice(0, 65_536))
|
|
1033
|
+
expect(sink).to be_closed
|
|
1034
|
+
expect(api.requests).to be_empty
|
|
1035
|
+
end
|
|
1036
|
+
|
|
1037
|
+
it "starts nothing more when cancelled before the change is settled, or while the restart asks for its URL" do
|
|
1038
|
+
Files.max_network_retries = 2
|
|
1039
|
+
control = Files::Transfer::Control.new
|
|
1040
|
+
store = storage_server(answer: lambda { |request, default|
|
|
1041
|
+
next default unless request.headers["if-match"]
|
|
1042
|
+
|
|
1043
|
+
control.cancel
|
|
1044
|
+
refused
|
|
1045
|
+
}
|
|
1046
|
+
)
|
|
1047
|
+
api = api_server(store)
|
|
1048
|
+
Dir.mktmpdir do |dir|
|
|
1049
|
+
expect { remote_file(store).download_file(File.join(dir, "report.bin"), transfer: transfer.merge(control: control)) }
|
|
1050
|
+
.to raise_error(Files::Transfer::CancelledError)
|
|
1051
|
+
end
|
|
1052
|
+
expect(api.requests).to be_empty
|
|
1053
|
+
|
|
1054
|
+
control = Files::Transfer::Control.new
|
|
1055
|
+
store = refusing_ranges
|
|
1056
|
+
api = api_server(store, on_lookup: -> { control.cancel })
|
|
1057
|
+
Dir.mktmpdir do |dir|
|
|
1058
|
+
expect { remote_file(store).download_file(File.join(dir, "report.bin"), transfer: transfer.merge(control: control)) }
|
|
1059
|
+
.to raise_error(Files::Transfer::CancelledError)
|
|
1060
|
+
end
|
|
1061
|
+
expect(api.requests.size).to eq(1)
|
|
1062
|
+
expect(ranges(store).count("bytes=0-65535")).to eq(1)
|
|
1063
|
+
end
|
|
1064
|
+
end
|
|
1065
|
+
|
|
767
1066
|
describe "refusals" do
|
|
768
1067
|
it "refuses a response from the Files.com web app before writing any of it, and closes the IO" do
|
|
769
1068
|
page = "<html>Sign in</html>"
|
|
@@ -919,6 +1218,38 @@ RSpec.describe Files::File, "adaptive downloads" do
|
|
|
919
1218
|
end
|
|
920
1219
|
end
|
|
921
1220
|
|
|
1221
|
+
# The resume's own URL still serves the old version, which storage refuses: within its retries the local file
|
|
1222
|
+
# starts over from its first byte, with a new URL and the new size, dropping the bytes the checkpoint vouched for.
|
|
1223
|
+
it "starts a resumed local file over, with a new URL and size, when the version it paused with has changed" do
|
|
1224
|
+
Files.max_network_retries = 1
|
|
1225
|
+
changed = false
|
|
1226
|
+
new_content = Random.new(9).bytes((5 * 65_536) + 123)
|
|
1227
|
+
store, control = pause_after_first_range(lambda { |request, default|
|
|
1228
|
+
changed && request.headers["if-match"] ? TransferServer.response("412 Precondition Failed", { "Content-Length" => 0 }) : default
|
|
1229
|
+
}
|
|
1230
|
+
)
|
|
1231
|
+
fresh = storage_server(new_content, etag: "\"v2\"")
|
|
1232
|
+
# The resume looks its URL up (the old one), and the restart a URL for the new version.
|
|
1233
|
+
lookups = 0
|
|
1234
|
+
api_server(-> { (lookups += 1) == 1 ? store : fresh })
|
|
1235
|
+
|
|
1236
|
+
Dir.mktmpdir do |dir|
|
|
1237
|
+
local_path = File.join(dir, "report.bin")
|
|
1238
|
+
paused = nil
|
|
1239
|
+
expect { remote_file(store).download_file(local_path, transfer: transfer.merge(concurrency: 1, control: control)) }
|
|
1240
|
+
.to raise_error(Files::Transfer::PausedError) { |error| paused = error }
|
|
1241
|
+
changed = true
|
|
1242
|
+
resumed_from = store.requests.size
|
|
1243
|
+
|
|
1244
|
+
described_class.resume_download(paused.checkpoint, nil, {}, transfer: transfer)
|
|
1245
|
+
|
|
1246
|
+
expect(File.binread(local_path)).to eq(new_content)
|
|
1247
|
+
expect(store.requests.drop(resumed_from).map { |request| request.headers.values_at("range", "if-match") }).to eq([ [ "bytes=131072-196607", "\"v1\"" ] ])
|
|
1248
|
+
expect(fresh.requests.first.headers.values_at("range", "if-match")).to eq([ "bytes=0-65535", nil ])
|
|
1249
|
+
end
|
|
1250
|
+
expect(lookups).to eq(2)
|
|
1251
|
+
end
|
|
1252
|
+
|
|
922
1253
|
it "resumes into the same IO only" do
|
|
923
1254
|
store, control = pause_after_first_range
|
|
924
1255
|
api_server(store)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: files.com
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.829
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- files.com
|
|
@@ -537,6 +537,7 @@ files:
|
|
|
537
537
|
- doc/Files/Transfer/DownloadCoordinator/FileSink.html
|
|
538
538
|
- doc/Files/Transfer/DownloadCoordinator/IoSink.html
|
|
539
539
|
- doc/Files/Transfer/DownloadCoordinator/Piece.html
|
|
540
|
+
- doc/Files/Transfer/DownloadDate.html
|
|
540
541
|
- doc/Files/Transfer/FileSlots.html
|
|
541
542
|
- doc/Files/Transfer/FrontendResponseError.html
|
|
542
543
|
- doc/Files/Transfer/Holds.html
|
|
@@ -925,6 +926,7 @@ files:
|
|
|
925
926
|
- lib/files.com/transfer/clock.rb
|
|
926
927
|
- lib/files.com/transfer/controller.rb
|
|
927
928
|
- lib/files.com/transfer/download_coordinator.rb
|
|
929
|
+
- lib/files.com/transfer/download_date.rb
|
|
928
930
|
- lib/files.com/transfer/errors.rb
|
|
929
931
|
- lib/files.com/transfer/http_transport.rb
|
|
930
932
|
- lib/files.com/transfer/job.rb
|