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

fix: some bugs in swift protobuf #276

Merged
merged 2 commits into from
Sep 27, 2023
Merged

fix: some bugs in swift protobuf #276

merged 2 commits into from
Sep 27, 2023

Conversation

YoloMao
Copy link
Collaborator

@YoloMao YoloMao commented Sep 27, 2023

  • fix: swift protobuf 中 timezoneOffset 数据类型为 String
  • fix: swift protobuf 中 toJson 后 timestamp 应为 Number 类型

见:#248 (comment)

Int64 类型在 proto3 JSON Mapping 默认为 String 类型,apple/swift-protobuf 提供将 Int64 转为 Number,但截止 1.21.0 版本,尚未合并到发布分支上;对于 SDK运行过程中,toJSON 仅在打印调试日志 / Advert 模块获取 eventName 时调用,Int64 转 String 或 Number 并不影响功能正常执行;

现在 SDK 有 3.x 升到 4.x 的逻辑,如果在 3.x 集成了 SwiftProtobuf 模块产生了事件并且没发送,升级到 4.x 后又通过初始化配置 config?.useProtobuf = false 使用 JSON 类型发送该事件,那么经由 apple/swift-protobuf 转化过后的事件字段 timestamp(目前 SDK 中仅 timestamp 为 Int64)为 String 是不正确的,应该改成 Number

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #276 (de8519f) into master (5769db9) will increase coverage by 0.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #276      +/-   ##
==========================================
+ Coverage   81.84%   81.95%   +0.11%     
==========================================
  Files         135      135              
  Lines        9562     9562              
==========================================
+ Hits         7826     7837      +11     
+ Misses       1736     1725      -11     

see 1 file with indirect coverage changes

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@YoloMao YoloMao merged commit 613f325 into master Sep 27, 2023
6 checks passed
@YoloMao YoloMao deleted the fix/swiftprotobuf branch September 27, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants