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: the reaction codec crash #113

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ repositories {
dependencies {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
implementation "org.xmtp:android:0.6.0"
implementation "org.xmtp:android:0.6.2"
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.facebook.react:react-native:0.71.3'
implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import org.xmtp.android.library.codecs.Reply
import org.xmtp.android.library.codecs.ReplyCodec
import org.xmtp.android.library.codecs.TextCodec
import org.xmtp.android.library.codecs.description
import org.xmtp.android.library.codecs.getReactionAction
import org.xmtp.android.library.codecs.getReactionSchema
import org.xmtp.android.library.codecs.id

import java.lang.Exception
Expand Down Expand Up @@ -80,8 +82,8 @@ class ContentJson(
val reaction = obj.get("reaction").asJsonObject
return ContentJson(ContentTypeReaction, Reaction(
reference = reaction.get("reference").asString,
action = ReactionAction.valueOf(reaction.get("action").asString),
schema = ReactionSchema.valueOf(reaction.get("schema").asString),
action = getReactionAction(reaction.get("action").asString.lowercase()),
schema = getReactionSchema(reaction.get("schema").asString.lowercase()),
content = reaction.get("content").asString,
))
} else if (obj.has("reply")) {
Expand Down
20 changes: 10 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- BigInt (5.0.0)
- boost (1.76.0)
- Connect-Swift (0.6.0):
- SwiftProtobuf (~> 1.22.0)
- Connect-Swift (0.7.0):
- SwiftProtobuf (~> 1.23.0)
- DoubleConversion (1.1.6)
- EXApplication (5.1.1):
- ExpoModulesCore
Expand Down Expand Up @@ -409,21 +409,21 @@ PODS:
- RNSVG (13.9.0):
- React-Core
- secp256k1.swift (0.1.4)
- SwiftProtobuf (1.22.1)
- SwiftProtobuf (1.23.0)
- web3.swift (1.6.0):
- BigInt (~> 5.0.0)
- GenericJSON (~> 2.0)
- Logging (~> 1.0.0)
- secp256k1.swift (~> 0.1)
- XMTP (0.5.3-alpha0):
- XMTP (0.5.4-alpha0):
- Connect-Swift
- GzipSwift
- web3.swift
- XMTPRust (= 0.3.1-beta0)
- XMTPReactNative (0.1.0):
- ExpoModulesCore
- MessagePacker
- XMTP (= 0.5.3-alpha0)
- XMTP (= 0.5.4-alpha0)
- XMTPRust (0.3.1-beta0)
- Yoga (1.14.0)

Expand Down Expand Up @@ -617,7 +617,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BigInt: 74b4d88367b0e819d9f77393549226d36faeb0d8
boost: 57d2868c099736d80fcd648bf211b4431e51a558
Connect-Swift: ba76bc64b2153cacce4f7985a21d4d81473dac90
Connect-Swift: 3b305e8305a8b88a33be087dad207d84aad57dd2
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
EXApplication: d8f53a7eee90a870a75656280e8d4b85726ea903
EXConstants: f348da07e21b23d2b085e270d7b74f282df1a7d9
Expand Down Expand Up @@ -678,13 +678,13 @@ SPEC CHECKSUMS:
RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f
RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
SwiftProtobuf: 7773c4e96a99d7b8ab7cda0fc30a883732ff93b1
SwiftProtobuf: b70d65f419fbfe61a2d58003456ca5da58e337d6
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
XMTP: 01fd25bc966b9546f1a04210d4162764861b076d
XMTPReactNative: 6feac2b747871f469660b43b85576efaa6c558d1
XMTP: 8e220d6c064c293911d88adb08087b90d06c22c5
XMTPReactNative: cfa66e30fa730f3b5f6cb4fed64eb3d11552e4b6
XMTPRust: 78f65f77b1454392980da244961777aee955652f
Yoga: 065f0b74dba4832d6e328238de46eb72c5de9556

PODFILE CHECKSUM: 522d88edc2d5fac4825e60a121c24abc18983367

COCOAPODS: 1.12.1
COCOAPODS: 1.11.3
2 changes: 1 addition & 1 deletion ios/XMTPReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Pod::Spec.new do |s|

s.source_files = "**/*.{h,m,swift}"
s.dependency "MessagePacker"
s.dependency "XMTP", "= 0.5.3-alpha0"
s.dependency "XMTP", "= 0.5.4-alpha0"
end
4 changes: 2 additions & 2 deletions src/XMTP.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export type ReplyContent = {

export type ReactionContent = {
reference: string;
action: "added" | "removed";
schema: "unicode" | "shortcode" | "custom";
action: "added" | "removed" | "unknown";
schema: "unicode" | "shortcode" | "custom" | "unknown";
content: string;
};

Expand Down
Loading