Giter Site home page Giter Site logo

Comments (5)

awalias avatar awalias commented on May 5, 2024 2

fixed in 0.7.2

from realtime.

kiwicopple avatar kiwicopple commented on May 5, 2024

Dubugged these a bit
I think the culprit is this line.

As DELETE transactions don't have change.record to enumerate over (unless the user has set REPLICA IDENTITY FULL in postgres). It does have the "old_record" though (i think), so we might be able to enumerate over that instead

from realtime.

kiwicopple avatar kiwicopple commented on May 5, 2024

Looks good. The patch for the other issue just a matter of wrapping this block with an if change.record

image

The reason why (i think) is that this function is getting called when the replication starts, and there are no actual changes in the transaction.

Let's test your changes for now though. Do you need me to push to docker hub?

from realtime.

awalias avatar awalias commented on May 5, 2024

last remaining thing to fix is 04:33:14.166 [error] GenServer #PID<0.2513.0> terminating ** (KeyError) key :record not found in: %Realtime.Adapters.Changes.DeletedRecord{columns: [%Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "id", type: "int8", type_modifier: 4294967295}, %Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "inserted_at", type: "timestamp", type_modifier: 4294967295}, %Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "updated_at", type: "timestamp", type_modifier: 4294967295}, %Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "data", type: "jsonb", type_modifier: 4294967295}, %Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "message", type: "text", type_modifier: 4294967295}, %Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "user_id", type: "int8", type_modifier: 4294967295}, %Realtime.Decoder.Messages.Relation.Column{flags: [:key], name: "channel_id", type: "int8", type_modifier: 4294967295}], commit_timestamp: ~U[2020-03-16 04:33:14Z], old_record: %{"channel_id" => "1", "data" => nil, "id" => "50", "inserted_at" => "2020-03-16 04:33:14.144909", "message" => "delete test", "updated_at" => "2020-03-16 04:33:14.144909", "user_id" => "1"}, schema: "public", table: "messages", type: "DELETE"}

from realtime.

awalias avatar awalias commented on May 5, 2024

oh sorry just saw you already posted the fix above, will make the change now, I tested the previous fix and it works well

from realtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.