-
Notifications
You must be signed in to change notification settings - Fork 4
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
Apply updates from yorkie-js-sdk v0.4.27 #192
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f3a4593
Added the generated ErrorInfo model from googleapis/google/rpc/error_…
hiddenviewer 66373ca
Add YorkieService wrapper for YorkieServiceClient with API mocking su…
hiddenviewer fe6ddf6
Handle retry for syncLoop and watchLoop / Handle ErrClientNotActivate…
hiddenviewer 29892c0
Fix watch loop reconnect timer issue in manual syncMode
hiddenviewer cd2b367
Fix ensure onlineClients are reset on document detach
hiddenviewer dc52a5b
Handle local changes correctly when receiving snapshot
hiddenviewer 278b2fe
Fix Xcode warnings
hiddenviewer f0afc0f
Apply SwiftFormat
hiddenviewer b26b38e
Fix 1 failing test in ClientIntegrationTests
hiddenviewer 6615b47
Apply review comments by coderabbitai
hiddenviewer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
Sources/API/V1/Generated/googleapis/google/rpc/error_details.pb.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// DO NOT EDIT. | ||
// swift-format-ignore-file | ||
// swiftlint:disable all | ||
// | ||
// Generated by the Swift generator plugin for the protocol buffer compiler. | ||
// Source: googleapis/google/rpc/error_details.proto | ||
// | ||
// For information on using the generated types, please see the documentation: | ||
// https://github.com/apple/swift-protobuf/ | ||
|
||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import SwiftProtobuf | ||
|
||
// If the compiler emits an error on this type, it is because this file | ||
// was generated by a version of the `protoc` Swift plug-in that is | ||
// incompatible with the version of SwiftProtobuf to which you are linking. | ||
// Please ensure that you are building against the same version of the API | ||
// that was used to generate this file. | ||
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { | ||
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} | ||
typealias Version = _2 | ||
} | ||
|
||
public struct Google_Rpc_ErrorInfo: @unchecked Sendable { | ||
// SwiftProtobuf.Message conformance is added in an extension below. See the | ||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for | ||
// methods supported on all messages. | ||
|
||
/// The reason of the error. This is a constant value that identifies the | ||
/// proximate cause of the error. Error reasons are unique within a particular | ||
/// domain of errors. This should be at most 63 characters and match a | ||
/// regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents | ||
/// UPPER_SNAKE_CASE. | ||
public var reason: String = String() | ||
|
||
/// The logical grouping to which the "reason" belongs. The error domain | ||
/// is typically the registered service name of the tool or product that | ||
/// generates the error. Example: "pubsub.googleapis.com". If the error is | ||
/// generated by some common infrastructure, the error domain must be a | ||
/// globally unique value that identifies the infrastructure. For Google API | ||
/// infrastructure, the error domain is "googleapis.com". | ||
public var domain: String = String() | ||
|
||
/// Additional structured details about this error. | ||
/// | ||
/// Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should | ||
/// ideally be lowerCamelCase. Also, they must be limited to 64 characters in | ||
/// length. When identifying the current value of an exceeded limit, the units | ||
/// should be contained in the key, not the value. For example, rather than | ||
/// `{"instanceLimit": "100/request"}`, should be returned as, | ||
/// `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of | ||
/// instances that can be created in a single (batch) request. | ||
public var metadata: Dictionary<String,String> = [:] | ||
|
||
public var unknownFields = SwiftProtobuf.UnknownStorage() | ||
|
||
public init() {} | ||
} | ||
|
||
// MARK: - Code below here is support for the SwiftProtobuf runtime. | ||
|
||
fileprivate let _protobuf_package = "google.rpc" | ||
|
||
extension Google_Rpc_ErrorInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { | ||
public static let protoMessageName: String = _protobuf_package + ".ErrorInfo" | ||
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ | ||
1: .same(proto: "reason"), | ||
2: .same(proto: "domain"), | ||
3: .same(proto: "metadata"), | ||
] | ||
|
||
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { | ||
while let fieldNumber = try decoder.nextFieldNumber() { | ||
// The use of inline closures is to circumvent an issue where the compiler | ||
// allocates stack space for every case branch when no optimizations are | ||
// enabled. https://github.com/apple/swift-protobuf/issues/1034 | ||
switch fieldNumber { | ||
case 1: try { try decoder.decodeSingularStringField(value: &self.reason) }() | ||
case 2: try { try decoder.decodeSingularStringField(value: &self.domain) }() | ||
case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.metadata) }() | ||
default: break | ||
} | ||
} | ||
} | ||
|
||
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { | ||
if !self.reason.isEmpty { | ||
try visitor.visitSingularStringField(value: self.reason, fieldNumber: 1) | ||
} | ||
if !self.domain.isEmpty { | ||
try visitor.visitSingularStringField(value: self.domain, fieldNumber: 2) | ||
} | ||
if !self.metadata.isEmpty { | ||
try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.metadata, fieldNumber: 3) | ||
} | ||
try unknownFields.traverse(visitor: &visitor) | ||
} | ||
|
||
public static func ==(lhs: Google_Rpc_ErrorInfo, rhs: Google_Rpc_ErrorInfo) -> Bool { | ||
if lhs.reason != rhs.reason {return false} | ||
if lhs.domain != rhs.domain {return false} | ||
if lhs.metadata != rhs.metadata {return false} | ||
if lhs.unknownFields != rhs.unknownFields {return false} | ||
return true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.rpc; | ||
|
||
import "google/protobuf/duration.proto"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove unused import. The import of Apply this diff to remove the unused import: -import "google/protobuf/duration.proto"; 🧰 Tools🪛 buf (1.47.2)19-19: Import "google/protobuf/duration.proto" is unused. (IMPORT_USED) |
||
|
||
option go_package = "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "ErrorDetailsProto"; | ||
option java_package = "com.google.rpc"; | ||
option objc_class_prefix = "RPC"; | ||
|
||
message ErrorInfo { | ||
// The reason of the error. This is a constant value that identifies the | ||
// proximate cause of the error. Error reasons are unique within a particular | ||
// domain of errors. This should be at most 63 characters and match a | ||
// regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents | ||
// UPPER_SNAKE_CASE. | ||
string reason = 1; | ||
|
||
// The logical grouping to which the "reason" belongs. The error domain | ||
// is typically the registered service name of the tool or product that | ||
// generates the error. Example: "pubsub.googleapis.com". If the error is | ||
// generated by some common infrastructure, the error domain must be a | ||
// globally unique value that identifies the infrastructure. For Google API | ||
// infrastructure, the error domain is "googleapis.com". | ||
string domain = 2; | ||
|
||
// Additional structured details about this error. | ||
// | ||
// Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should | ||
// ideally be lowerCamelCase. Also, they must be limited to 64 characters in | ||
// length. When identifying the current value of an exceeded limit, the units | ||
// should be contained in the key, not the value. For example, rather than | ||
// `{"instanceLimit": "100/request"}`, should be returned as, | ||
// `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of | ||
// instances that can be created in a single (batch) request. | ||
map<string, string> metadata = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update package declaration to follow protobuf best practices.
The package declaration has two issues that should be addressed:
google.rpc.v1
).Apply this diff to update the package declaration:
Additionally, ensure the file is placed in a directory structure that matches its package name, relative to the proto root directory.
📝 Committable suggestion
🧰 Tools
🪛 buf (1.47.2)
17-17: Files with package "google.rpc" must be within a directory "google/rpc" relative to root but were in directory "Sources/API/V1/googleapis/google/rpc".
(PACKAGE_DIRECTORY_MATCH)
17-17: Package name "google.rpc" should be suffixed with a correctly formed version, such as "google.rpc.v1".
(PACKAGE_VERSION_SUFFIX)