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

#1571 - Create vuex module for chat #1854

Merged
merged 12 commits into from
Feb 23, 2024

Conversation

SebinSong
Copy link
Collaborator

@SebinSong SebinSong commented Feb 20, 2024

closes #1571

The work was done based on the docs here: https://v3.vuex.vuejs.org/guide/modules.html

@SebinSong SebinSong self-assigned this Feb 20, 2024
@SebinSong SebinSong changed the title #1571 - Create vuex module for chat [ WIP ] #1571 - Create vuex module for chat Feb 20, 2024
Copy link

cypress bot commented Feb 20, 2024

Passing run #1910 ↗︎

0 110 8 0 Flakiness 0

Details:

Merge f95234b into ccbe124...
Project: group-income Commit: c692e6e268 ℹ️
Status: Passed Duration: 10:40 💡
Started: Feb 23, 2024 5:12 PM Ended: Feb 23, 2024 5:23 PM

Review all test suite changes for PR #1854 ↗︎

@SebinSong SebinSong changed the title [ WIP ] #1571 - Create vuex module for chat #1571 - Create vuex module for chat Feb 20, 2024
taoeffect
taoeffect previously approved these changes Feb 21, 2024
Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Nice! I couldn't find any issues... but this is a significant change so I'm going to wait on either @Silver-IT and/or @corrideat for another approval before merging.

Comment on lines 73 to 89
const chatroomState = state.chatroom || {}
// TODO: need to remove the whole content after we release 0.2.*
for (const chatRoomId in state.chatRoomUnread) {
if (!state.chatRoomUnread[chatRoomId].messages) {
state.chatRoomUnread[chatRoomId].messages = []
for (const chatRoomId in chatroomState.chatRoomUnread) {
if (!chatroomState.chatRoomUnread[chatRoomId].messages) {
chatroomState.chatRoomUnread[chatRoomId].messages = []
}
if (state.chatRoomUnread[chatRoomId].mentions) {
state.chatRoomUnread[chatRoomId].mentions.forEach(m => {
state.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.TEXT }, m))
if (chatroomState.chatRoomUnread[chatRoomId].mentions) {
chatroomState.chatRoomUnread[chatRoomId].mentions.forEach(m => {
chatroomState.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.TEXT }, m))
})
Vue.delete(state.chatRoomUnread[chatRoomId], 'mentions')
Vue.delete(chatroomState.chatRoomUnread[chatRoomId], 'mentions')
}
if (state.chatRoomUnread[chatRoomId].others) {
state.chatRoomUnread[chatRoomId].others.forEach(o => {
state.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.INTERACTIVE }, o))
if (chatroomState.chatRoomUnread[chatRoomId].others) {
chatroomState.chatRoomUnread[chatRoomId].others.forEach(o => {
chatroomState.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.INTERACTIVE }, o))
})
Vue.delete(state.chatRoomUnread[chatRoomId], 'others')
Vue.delete(chatroomState.chatRoomUnread[chatRoomId], 'others')
Copy link
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 delete this whole section now since the groups will need to be recreated anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, correct. As we can see in the comment above, we could clear the state/vuex/postUpgradeVerification as we have already published version 0.2.0.

Silver-IT
Silver-IT previously approved these changes Feb 23, 2024
Copy link
Member

@Silver-IT Silver-IT left a comment

Choose a reason for hiding this comment

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

I don't find any issues too.

Comment on lines 73 to 89
const chatroomState = state.chatroom || {}
// TODO: need to remove the whole content after we release 0.2.*
for (const chatRoomId in state.chatRoomUnread) {
if (!state.chatRoomUnread[chatRoomId].messages) {
state.chatRoomUnread[chatRoomId].messages = []
for (const chatRoomId in chatroomState.chatRoomUnread) {
if (!chatroomState.chatRoomUnread[chatRoomId].messages) {
chatroomState.chatRoomUnread[chatRoomId].messages = []
}
if (state.chatRoomUnread[chatRoomId].mentions) {
state.chatRoomUnread[chatRoomId].mentions.forEach(m => {
state.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.TEXT }, m))
if (chatroomState.chatRoomUnread[chatRoomId].mentions) {
chatroomState.chatRoomUnread[chatRoomId].mentions.forEach(m => {
chatroomState.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.TEXT }, m))
})
Vue.delete(state.chatRoomUnread[chatRoomId], 'mentions')
Vue.delete(chatroomState.chatRoomUnread[chatRoomId], 'mentions')
}
if (state.chatRoomUnread[chatRoomId].others) {
state.chatRoomUnread[chatRoomId].others.forEach(o => {
state.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.INTERACTIVE }, o))
if (chatroomState.chatRoomUnread[chatRoomId].others) {
chatroomState.chatRoomUnread[chatRoomId].others.forEach(o => {
chatroomState.chatRoomUnread[chatRoomId].messages.push(Object.assign({ type: MESSAGE_TYPES.INTERACTIVE }, o))
})
Vue.delete(state.chatRoomUnread[chatRoomId], 'others')
Vue.delete(chatroomState.chatRoomUnread[chatRoomId], 'others')
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, correct. As we can see in the comment above, we could clear the state/vuex/postUpgradeVerification as we have already published version 0.2.0.

corrideat
corrideat previously approved these changes Feb 23, 2024
@taoeffect taoeffect dismissed stale reviews from corrideat and Silver-IT via f95234b February 23, 2024 17:11
@taoeffect taoeffect merged commit 839a132 into master Feb 23, 2024
4 checks passed
@taoeffect taoeffect deleted the sebin/task/#1571-create-vuex-module-for-chat branch February 23, 2024 17:28
corrideat pushed a commit that referenced this pull request Mar 4, 2024
* add chatroom/vuexModule.js with some boilerplate code in there

* fix a linter error

* move chat&DM related getters in state.js to the chatroom vuexModule

* move all the chatroom-relateed mutations to the vuexModules

* add chatroom vuexModule to store in state.js

* a small bug-fix for re-login process

* typo fix for the cypress failure

* remove postUpgradeVerification code (resetting groups anyway)

---------

Co-authored-by: Greg Slepak <[email protected]>
corrideat pushed a commit that referenced this pull request Mar 4, 2024
* add chatroom/vuexModule.js with some boilerplate code in there

* fix a linter error

* move chat&DM related getters in state.js to the chatroom vuexModule

* move all the chatroom-relateed mutations to the vuexModules

* add chatroom vuexModule to store in state.js

* a small bug-fix for re-login process

* typo fix for the cypress failure

* remove postUpgradeVerification code (resetting groups anyway)

---------

Co-authored-by: Greg Slepak <[email protected]>
taoeffect added a commit that referenced this pull request Mar 14, 2024
* Add limit to eventsAfter

* Minor cleanup

* Convert circularClassList.js into a class

* Simplify streamEventsAfter

* Remove a bit of debugging in addEntry

* Handle read() error in streamEventsAfter

* No longer reverse entries in streamEventsAfter

* fix the double dialog box issue

* Remove pepper, read secret from file and minimise the number of secrets

* Signature verification

* Remove groupContractID in chatroom contract attributes (#1847)

* feat: removed groupContractID in chatroom attributes

* fix: recovered package.json

* chore: remove unnecessary getter

* chore: updated manifest

* Fix error to close CreatePoll modal by clicking sidebar (#1849)

* fix: error to close CreatePoll modal by clicking sidebar

* chore: added comment for better understanding

* chore: fixed typo

* fix: make notification after identity contract is fully synced (#1848)

* #1851 - Fix the broken VoterAvatars.vue component (#1852)

* add a fix for Prompt.vue not being closed properly

* fix the broken VoterAvatars.vue

* Replace checks to use _private instead of _private_

* Remove notifications while leaving group (#1859)

* fix: error in removing notifications after leaving group

* chore: random commit for running travis again

* Encrypted files (#1858)

* WIP upload files

* Files uploading (wip)

* Files uploading, HAPI integration (wip)

* File upload and download

* Encrypted files

* Changes to dowload API for ergonomics and manifest processing

* Avatar types

* File caching

* Documentation

* Update avatar types in Message* classes

* Fix flow errors

* Remove streams check for Node.js

* Fix tests & feedback

* Fix tests & feedback (again)

* Fix tests for Node 18

* Fix test

Co-authored-by: Greg Slepak <[email protected]>

---------

Co-authored-by: Greg Slepak <[email protected]>

* Fix streams support

* Fix error in getting updated with the user's profile after rejoining group (#1864)

* fix: sharing new PEKs

* chore: grunt pin:0.2.5

* chore: reverted grunt pin and removed manifest.json

---------

Co-authored-by: Greg Slepak <[email protected]>

* #1571 - Create vuex module for chat (#1854)

* add chatroom/vuexModule.js with some boilerplate code in there

* fix a linter error

* move chat&DM related getters in state.js to the chatroom vuexModule

* move all the chatroom-relateed mutations to the vuexModules

* add chatroom vuexModule to store in state.js

* a small bug-fix for re-login process

* typo fix for the cypress failure

* remove postUpgradeVerification code (resetting groups anyway)

---------

Co-authored-by: Greg Slepak <[email protected]>

* Fix issue #1857

* Fix incorrect badge while switching group (#1863)

* fix: incorrect badge from direct messages

* chore: grunt pin:0.2.4

* chore: reverted version 0.2.4

* chore: reverted the grunt pin:0.2.3 too

* chore: removed manifest.json

* fix the overflow bug

* Fix error to display profile picture for DMs with more than 2 people (#1869)

* fix: error to select avatar for direct messages

* chore: follow-up process for changes of getters

* fix: error in getting direct messages by groupID

* fix: syntax error

* 32 logging (#1870)

* pino enabled, still need to fix logging behavior though

* fix flow errors

* pino support seems to be working

* one minor fix for %s strings. Closes #32

* fix some error logging in pubsub + remove hapi-pino

* Convert eventsAfter to stream (missing: change usage in ChatMain)

* API improvements

* Endpoint consolidation

* Fix subscriptionSet issues

* Fix chatroom race condition

* Log instead of throw

* Cleaning up

* Linting

---------

Co-authored-by: snowteamer <[email protected]>
Co-authored-by: SebinSong <[email protected]>
Co-authored-by: Alex Jin <[email protected]>
Co-authored-by: Greg Slepak <[email protected]>
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.

Create Vuex module for chat related settings
4 participants