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

Update openapi #4

Merged
merged 21 commits into from
Oct 2, 2024
Merged

Update openapi #4

merged 21 commits into from
Oct 2, 2024

Conversation

Karolk99
Copy link
Collaborator

@Karolk99 Karolk99 commented Sep 18, 2024

Working on RoomManager example

@roznawsk
Copy link
Collaborator

What about the failing tests? There have been a lot of updates in the openapi, so we should make some updates in the client?

@Karolk99
Copy link
Collaborator Author

What about the failing tests? There have been a lot of updates in the openapi, so we should make some updates in the client?

First of all, I fixed GitHub workflow and current tests (9) are failing

"Room",
"RoomConfig",
"RoomConfigVideoCodec",
"Peer",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing Peer and PeerStatus? Isn't it needed when rendering the response when getting all rooms?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also PeerToken, Room (from _room_api) are missing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now all types are imported under fishjam namespace

"""Returns list of all rooms"""

return self._request(room_get_all_rooms).data
def create_room(self, options: RoomOptions = RoomOptions()) -> Room:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be passing the room options directly in the create_room method, instead of passing config.
This doesn't require creating the RoomOptions object each time we create room. Also, options are the only argument to the create_room method, so using RoomOptions seems redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After our conversation with @AHGIJMKLKKZNPJKQR, we decide to leave as it is.

@roznawsk
Copy link
Collaborator

I know that we will likely update README's for all projects later, but I think we can update slightly it in this PR, e.g. remove example of adding component.

@Karolk99
Copy link
Collaborator Author

I know that we will likely update README's for all projects later, but I think we can update slightly it in this PR, e.g. remove example of adding component.

I'm planning to rewrite the whole README in this PR but first I want to have accepted SKD API

.github/workflows/publish.yml Outdated Show resolved Hide resolved
examples/room-manager/room_service.py Outdated Show resolved Hide resolved
fishjam/_ws_notifier.py Outdated Show resolved Hide resolved
fishjam/api/_fishjam_client.py Outdated Show resolved Hide resolved
fishjam/api/_fishjam_client.py Outdated Show resolved Hide resolved
fishjam/api/_fishjam_client.py Outdated Show resolved Hide resolved
Copy link

@AHGIJMKLKKZNPJKQR AHGIJMKLKKZNPJKQR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not stalling this any longer

README.md Outdated Show resolved Hide resolved


@dataclass
class Info:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Resource or Entity

Suggested change
class Info:
class Resource:

Comment on lines 165 to 166
peers = map(lambda peer: peer.id == peer_access.peer.id, room.peers)
return bool(peers)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always true if there are any peers in a room bool([False, False]) = True.

Suggested change
peers = map(lambda peer: peer.id == peer_access.peer.id, room.peers)
return bool(peers)
return any(peer.id == peer_access.peer.id for peer in room.peers)

if not peer_access or not peer_in_room:
return self.__create_peer(room_name, username)

self.logger.info("Peer and room exist: %s, %s", username, room_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: If room does exist we log room exists in the __find_or_create_room() and then we log peer and room exist. So we inform about room existence twice.

Comment on lines 152 to 159
room_name = None

for name, r_id in self.room_name_to_room_id.items():
if room_id == r_id:
room_name = name
break

return room_name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
room_name = None
for name, r_id in self.room_name_to_room_id.items():
if room_id == r_id:
room_name = name
break
return room_name
for name, r_id in self.room_name_to_room_id.items():
if room_id == r_id:
return name
return None

@@ -19,63 +32,64 @@
ServerMessageSubscribeResponse,
)

ALLOWED_NOTIFICATION = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a single place (module/ file) where the allowed notifications are stored - I don't see scenario where there are different ones for webhook and WsNotifier

@Karolk99 Karolk99 requested a review from roznawsk October 2, 2024 15:03
Copy link
Collaborator

@roznawsk roznawsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

360_F_116652906_y9YDrMad6vbHsUkFw9fjVG4uVeFNXcuM

@Karolk99 Karolk99 merged commit ee35ac5 into main Oct 2, 2024
2 checks passed
@Karolk99 Karolk99 deleted the update-openapi branch October 2, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants