Giter VIP home page Giter VIP logo

Comments (8)

nvie avatar nvie commented on September 22, 2024 1

Hi @amcdnl – thanks for opening a support ticket. The nesting of RoomProviders should not be an issue indeedβ€”it's supported since v1.5.0.

The useMutation callback can only be called after the initial storage document has been loaded by your application. Waiting for status === 'connected' is not enough for this. That is only the WebSocket status. After the WebSocket is connected, the Storage loading phase begins. You can listen for the storageStatus status instead. If it's synchronized or synchronizing, it means it has been loaded. You can find the relevant docs here.

Hope that helps to resolve it for you!

from liveblocks.

nvie avatar nvie commented on September 22, 2024 1

I realize that the error message may have put you on the wrong track. I'll get that fixed πŸ‘

from liveblocks.

amcdnl avatar amcdnl commented on September 22, 2024 1

Yup that works. Perhaps you should call that out in the docs. I'm going to close this now - thank you

from liveblocks.

amcdnl avatar amcdnl commented on September 22, 2024

@nvie - Sadly, it never moves out of not-connected. Any clues why this might be?

Quesiton: since i'm using 2 rooms, do i need 2 liveblocks.config.ts ?

from liveblocks.

nvie avatar nvie commented on September 22, 2024

@nvie - Sadly, it never moves out of not-connected. Any clues why this might be?

That's odd, and definitely unexpected. Could you add the following logging options?

In your client setup:

const client = createClient({
  /* options */,
  enableDebugLogging: true,
});

Also, could you maybe add the following effect in one of your top-level components?

const room = useRoom();
useEffect(() => {
  const unsub1 = room.events.status.subscribe((status) => console.log({ status }));
  const unsub2 = room.events.storageStatus.subscribe((storageStatus) => console.log({ storageStatus }));
  return () => {
    unsub1();
    unsub2();
  };
}, [room]);

Maybe that will give you a bit more debug info.

Quesiton: since i'm using 2 rooms, do i need 2 liveblocks.config.ts ?

You would only need to liveblocks configs if you have two room types (with different data shapes in each room type). If you have multiple room instances that all have the same data shape inside them you would not need two liveblocks configs. Can you tell me a bit more about these two room (types)?

from liveblocks.

amcdnl avatar amcdnl commented on September 22, 2024

@nvie - Here is the console output:

image

And here is my room structure - I have 1 main room called home and then a room for each session tab.

image

from liveblocks.

amcdnl avatar amcdnl commented on September 22, 2024

@nvie - This is fun, if I add const store = room.getStorage(); it seems to start working. I think its not binding until something tells it to listen?

from liveblocks.

nvie avatar nvie commented on September 22, 2024

@amcdnl Oh yeah, you will need to trigger a storage load explicitly, either by doing a .getStorage() call, or by using a hook like useStorage. I was under the assumption you were doing that already. Once storage starts loading, this should work for you. Please lmk if it is not!

from liveblocks.

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.