Skip to content

Create 021-presence-service#61

Open
eldadfux wants to merge 4 commits intomainfrom
eldadfux-patch-2
Open

Create 021-presence-service#61
eldadfux wants to merge 4 commits intomainfrom
eldadfux-patch-2

Conversation

@eldadfux
Copy link
Copy Markdown
Member

@eldadfux eldadfux commented Mar 21, 2024

# Presence service

* Creator: Eldad Fux
* Relevant Issues:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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


Create a presence. Set the user presence status, expiry (minutes/date - TBD), and permissions for who has access to see the current presence. This will imitate the equivalent action in the GraphQL and Realtime APIs.

```GET /v1/presences```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lets please add response model. Im curious if there will be connection between presence ID and user ID, and if its public.

Copy link
Copy Markdown

@Meldiron Meldiron Mar 22, 2024

Choose a reason for hiding this comment

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

I am also curious what data can I set on presence.. message, icon, color? picture, age, status?


```GET /v1/presences```

List all presences, on client side this will show only presneces I have permission to view. On server it will show all presences on the server. This endpoint will support queries and pagination like any other list endpoint on Appwrite.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hmm, I think we should have a shortcut for getting "my presences". I don't know how - I cant see good way. But I would still like it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could use a query filter with user id, but this is not as quick.

eldadfux and others added 2 commits March 22, 2024 11:28
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
### Console updates

- We should implement presence in the console itself and make current org members online or not or last online
- We will add a new section under auth called `Presences`, this section will show a dashboard with usage showing how many people were online in a specific time range. Below that, we will show avatars of all currently online users or users who just recently went offline.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hmm I imagined this as tab under user detail page. Can 1 user have multiple presences?

- userInternalId
- userId
- expiry (DateTime)
- status (string)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this should be JSON, since often apps need more than just a message. GitHub lets you set emoji. Discord lets you also set game you currently play. Instagram lets you ass music to your note.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

separate metadata and not storing inside the status itself as User can query by status as well

And having json on status can be performance bottleneck(mysql)

Having metadata allows user to have fancy status like we have in github, discord ,etc

- _updatedAt
- userInternalId
- userId
- expiry (DateTime)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will exipry be nullable - never delete?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can't allow a big expiry. There should be max value otherwise the stale presence count will be high. Max 15mins/1hour?

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.

4 participants