Giter Site home page Giter Site logo

Comments (11)

rreuvekamp avatar rreuvekamp commented on August 27, 2024

Claiming

from dendrite.

rreuvekamp avatar rreuvekamp commented on August 27, 2024

src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go:94

// TODO (#267): Check room ID doesn't clash with an existing one, and we
// probably shouldn't be using pseudo-random strings, maybe GUIDs?

This is something we can discuss.
From my understanding, the upside of using UUIDs is that you get a certain guarantee they are generated such to not collide easily. They should be more random then what util.RandomString currenly does (using math/rand).

Namespaces in UUIDs are not something we're interested in, because room IDs will already have the server name as suffix.

To me it seems like UUIDs are therefore overkill for this.

I'm not sure if things will break with larger room IDs. It seems synapse currently uses 18 character room IDs. I guess it wouldn't break things because room IDs are normally stored in their full form (including server suffix), so their length is dynamic anyway, but I can't say for certain.

from dendrite.

erikjohnston avatar erikjohnston commented on August 27, 2024

Yeah, UUIDs seem overkill for this, I'd probably set it up to ask the room server if the room id is free. Though that would require us to reserve our use of that room id on the room server, so that two client API instances can't race between asking about the room id and persisting the new room.

from dendrite.

rreuvekamp avatar rreuvekamp commented on August 27, 2024

Yeah, UUIDs seem overkill for this

Okay :)

Though that would require us to reserve our use of that room id on the room server

Or maybe the createroom of the roomserver's API should (optionally) just return an error if the room ID is already taken, therefore making the checking and registering one operation (from the clientapi's view). I'll take a look.

from dendrite.

erikjohnston avatar erikjohnston commented on August 27, 2024

I don't think there is a createRoom API on the room server, instead we just start shoving down events that create the room through the normal stream.

from dendrite.

erikjohnston avatar erikjohnston commented on August 27, 2024

I'd imagine the flow looks something like:

  1. Reserve the roomID from the room server (either the room server returns a free roomID or we'd want to retry if the randomly generated roomID had already been taken)
  2. Construct the events that create the room
  3. Send the events down the stream to the room server

from dendrite.

rreuvekamp avatar rreuvekamp commented on August 27, 2024

Ahh that explains it! So we need to know the room ID to use before the process of building and sending the events can start.

Working on it.

from dendrite.

rreuvekamp avatar rreuvekamp commented on August 27, 2024

Was a bit busy last weeks, but I'm still working on it!

from dendrite.

Cnly avatar Cnly commented on August 27, 2024

Hello @rreuvekamp, are you still interested in and working on this issue?

from dendrite.

rreuvekamp avatar rreuvekamp commented on August 27, 2024

Yes! I didn't realize I stop had it open, sorry.

I'll check to see if anything has changed in the meantime regarding those parts, and fix the issues that still need fixing.

I've got time on Sunday, so that will work out.

from dendrite.

kegsay avatar kegsay commented on August 27, 2024

I don't think we need this. #794 (comment)

from dendrite.

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.