fix: LiveQuery event lost for operation on class with pointer field#1863
Conversation
…ormat but PFDecoder.m checks for __type key which is missing as shown in below example so this fix will add "__type ":"Object" key-value if dictionary has className and objectId representing PFObject.
"object":{
"desc": "Technology",
"createdAt": "2020-10-03T19:34:16.823Z",
"updatedAt": "2025-09-27T17:55:02.360Z",
"image_name": "technology.png",
"className": "categories",
"objectId": "kHnBntWHHW"
},
"original": {
"desc": "Technologyy",
"createdAt": "2020-10-03T19:34:16.823Z",
"updatedAt": "2025-09-27T17:54:10.800Z",
"image_name": "technology.png",
"className": "categories",
"objectId": "kHnBntWHHW"
}
|
🚀 Thanks for opening this pull request! |
📝 WalkthroughWalkthroughInjects "__type":"Object" into dictionaries missing Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as Caller
participant PFDecoder as PFDecoder.decodeDictionary
participant ObjBranch as Object Branch
participant PFObject as PFObject
Caller->>PFDecoder: decodeDictionary(data)
alt __type missing AND className & objectId present
note right of PFDecoder #DDEBF7: Inject "__type":"Object" into mutable copy
PFDecoder->>ObjBranch: route with type="Object"
else __type present
PFDecoder->>ObjBranch: route based on __type
end
ObjBranch->>PFDecoder: recursively decode remaining fields
ObjBranch->>PFObject: construct with defaultClassName, objectId, data
PFDecoder-->>Caller: decoded PFObject
sequenceDiagram
autonumber
participant Server as Server Event
participant ClientBefore as LiveQuery Client (before)
participant Decoder as PFDecoder.object()
participant App as App Code
Server-->>ClientBefore: object dictionary (className, objectId, fields)
ClientBefore->>ClientBefore: validate className & objectId
ClientBefore->>Decoder: decode(...) as T
alt success
ClientBefore-->>App: return T
else failure
ClientBefore-->>App: throw decoding error
end
sequenceDiagram
autonumber
participant Server as Server Event
participant ClientNow as LiveQuery Client (now)
participant App as App Code
Server-->>ClientNow: object dictionary (className, objectId, fields)
ClientNow->>ClientNow: validate className & objectId
note right of ClientNow #F7F3E8: Typed decoding step removed
ClientNow-->>App: proceed without returning typed T here
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Parse/Parse/Source/PFDecoder.m(1 hunks)ParseLiveQuery/ParseLiveQuery/Internal/ClientPrivate.swift(0 hunks)
💤 Files with no reviewable changes (1)
- ParseLiveQuery/ParseLiveQuery/Internal/ClientPrivate.swift
…nd on the presence of additional data fields so that bare pointer stubs continue to fall back to the legacy dictionary path.
|
@mtrezza could you please review this? |
|
Hello, if my PR is in right direction then pls help. I have I am trying to run tests from /parse folder and also tried from root folder but failing. Not able to figure. |
|
Sharing build log. |
|
@ashish-naik I'm working on fixing the build #1865 if you want to take a look |
|
I don't have understanding of the change you are making but looking forward to it. Could you also take a look at this PR whether it is in right direction? live query functionality in my code is working with this change. |
|
This looks good to me! |
|
Thanks. Will wait for your PR to run the tests before merging ? |
|
iOS tests passed. |
|
@ashish-naik Can you rebase from master? |
|
done |
|
@mtrezza This looks good to me |
## [6.1.1](6.1.0...6.1.1) (2025-11-19) ### Bug Fixes * LiveQuery event lost for operation on class with pointer field ([#1863](#1863)) ([cfd1bc4](cfd1bc4))
|
🎉 This change has been released in version 6.1.1 |
Issue Description
Response from websocket server does not include "__type":"Object" but PFDecoder expects this otherwise events failed to be caught.
Closes: Issue #1832
Approach
LiveryQuery server response sends data or events in "object":jsonf= format but PFDecoder.m checks for __type key which is missing as shown in below example so this fix will add "__type ":"Object" key-value if dictionary has className and objectId representing PFObject.
Requesting review.
Summary by CodeRabbit
Bug Fixes
Refactor