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

feature/Users who request already-taken usernames should be invited to request a new username #1843

Merged
merged 44 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
90e3c83
desktop - container, stories, test
Kacper-RF Sep 20, 2023
1c76661
adjust component
Kacper-RF Sep 21, 2023
26032b6
Remove obsolete registrar code
vinkabuki Sep 21, 2023
0ec4d44
Unify registration function for owner and user
vinkabuki Sep 21, 2023
4bbe2cf
Clean up registrar methods logic
vinkabuki Sep 21, 2023
c4ba087
mobile - screens, component, tests
Kacper-RF Sep 21, 2023
e40c4d5
add changelog
Kacper-RF Sep 21, 2023
df94c25
organize code
vinkabuki Sep 21, 2023
3a80426
Remove test
vinkabuki Sep 21, 2023
36d58a1
Update changelog
vinkabuki Sep 21, 2023
2e8aec1
skip randomly failing websockets tests
vinkabuki Sep 21, 2023
0425139
connection with state manager
Kacper-RF Sep 22, 2023
884634a
next steps for pub and priv key
Kacper-RF Sep 22, 2023
762919e
map old messages to new nickname
Kacper-RF Sep 25, 2023
799ba21
use dictionary with counter for usernames
Kacper-RF Sep 26, 2023
bb71d69
changelog
Kacper-RF Sep 26, 2023
7ee91db
Add logic for graceful certificates and csrs handling in registrar
vinkabuki Sep 26, 2023
f3ae4db
Remove inadequate registrar tests
vinkabuki Sep 26, 2023
7b6f862
state manager tests
Kacper-RF Sep 26, 2023
309f6bd
changelog
Kacper-RF Sep 26, 2023
3b96e40
fix in selector, error handling when using taken nickname
Kacper-RF Sep 27, 2023
61a9437
check only registered users
Kacper-RF Sep 27, 2023
ee4fae8
Clean code and tests
vinkabuki Sep 27, 2023
9ce135e
merge
Kacper-RF Sep 27, 2023
c91d0fc
desktop test and linter
Kacper-RF Sep 27, 2023
781a2bb
add test case for registerCertificate saga
Kacper-RF Sep 27, 2023
b1d2f6b
show username taken screen on mobile, error handling on mobile
Kacper-RF Sep 28, 2023
bf46d04
fix mobile saga test
Kacper-RF Sep 28, 2023
ef746a0
Add tests for extracting pending csrs
vinkabuki Sep 28, 2023
3332578
merge
Kacper-RF Sep 28, 2023
c0b42f9
registerUsername saga test for case with username taken
Kacper-RF Sep 28, 2023
1fca2fe
cr fixes, fix updateCertificate saga
Kacper-RF Sep 29, 2023
5375941
Improve code quality after code review
vinkabuki Sep 29, 2023
e019b86
Merge branch 'feature/1697' of github.com:TryQuiet/quiet into feature…
vinkabuki Sep 29, 2023
b3ac445
cr fixes
Kacper-RF Oct 4, 2023
be32eb0
merge develop
Kacper-RF Oct 4, 2023
e6f7c42
Merge branch 'feature/1697' of github.com:TryQuiet/quiet into feature…
Kacper-RF Oct 4, 2023
eb28569
cleanup
Kacper-RF Oct 4, 2023
5617d5e
cleanup
Kacper-RF Oct 4, 2023
d60f9da
fix PR comments
vinkabuki Oct 4, 2023
7240e51
PR comments
vinkabuki Oct 5, 2023
525ea8b
Merged develop to feature/1697
vinkabuki Oct 5, 2023
203ede1
update snapshots
Kacper-RF Oct 5, 2023
9702f94
fix extractPendingCsrs method flaws
vinkabuki Oct 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

[unreleased]

* UI layer for taken usernames for desktop and mobile

* Change nickname for taken username

* Map messages sent before changing username

* Update registrar service to match new registration flow.

* Add possible impersonation attack UI for desktop and mobile

* Fix truncated long messages in channelInput component
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { jest } from '@jest/globals'
import { LazyModuleLoader } from '@nestjs/core'
import { Test, TestingModule } from '@nestjs/testing'
import { getFactory, prepareStore, type Store, type communities, type identity } from '@quiet/state-manager'
import { type Community, type Identity, type InitCommunityPayload, type LaunchRegistrarPayload } from '@quiet/types'
import { type Community, type Identity, type InitCommunityPayload } from '@quiet/types'
import { type FactoryGirl } from 'factory-girl'
import PeerId from 'peer-id'
import { TestModule } from '../common/test.module'
Expand Down Expand Up @@ -108,10 +108,8 @@ describe('ConnectionsManagerService', () => {
await connectionsManagerService.closeAllServices()

const launchCommunitySpy = jest.spyOn(connectionsManagerService, 'launchCommunity').mockResolvedValue()
const launchRegistrarSpy = jest.spyOn(registrationService, 'launchRegistrar').mockResolvedValue()

await connectionsManagerService.init()
expect(launchRegistrarSpy).not.toHaveBeenCalled()
expect(launchCommunitySpy).toHaveBeenCalledWith(launchCommunityPayload)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ import {
NetworkStats,
PushNotificationPayload,
RegisterOwnerCertificatePayload,
RegisterUserCertificatePayload,
RemoveDownloadStatus,
ResponseCreateNetworkPayload,
SaveCertificatePayload,
SaveOwnerCertificatePayload,
SendCertificatesResponse,
SendMessagePayload,
SetChannelSubscribedPayload,
Expand All @@ -43,7 +40,6 @@ import {
UploadFilePayload,
PeerId as PeerIdType,
SaveCSRPayload,
SendUserCertificatePayload,
CommunityMetadata,
CommunityMetadataPayload,
} from '@quiet/types'
Expand Down Expand Up @@ -178,10 +174,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
if (this.tor && !options.saveTor) {
await this.tor.kill()
}
if (this.registrationService) {
this.logger('Stopping registration service')
await this.registrationService.stop()
}
leblowl marked this conversation as resolved.
Show resolved Hide resolved
if (this.storageService) {
this.logger('Stopping orbitdb')
await this.storageService?.stopOrbitDb()
Expand Down Expand Up @@ -394,26 +386,11 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
this.socketService.on(SocketActionTypes.CONNECTION_PROCESS_INFO, data => {
this.serverIoProvider.io.emit(SocketActionTypes.CONNECTION_PROCESS_INFO, data)
})

this.registrationService.on(SocketActionTypes.CONNECTION_PROCESS_INFO, data => {
this.serverIoProvider.io.emit(SocketActionTypes.CONNECTION_PROCESS_INFO, data)
})
}
private attachRegistrationListeners() {
this.registrationService.on(RegistrationEvents.REGISTRAR_STATE, (payload: ServiceState) => {
this.registrarState = payload
})
this.registrationService.on(SocketActionTypes.SAVED_OWNER_CERTIFICATE, payload => {
this.serverIoProvider.io.emit(SocketActionTypes.SAVED_OWNER_CERTIFICATE, payload)
})
this.registrationService.on(RegistrationEvents.SPAWN_HS_FOR_REGISTRAR, async payload => {
const onionAddress = await this.tor.spawnHiddenService({
targetPort: payload.port,
privKey: payload.privateKey,
virtPort: payload.targetPort,
})
this.registrationService.onionAddress = onionAddress
})
this.registrationService.on(RegistrationEvents.ERROR, payload => {
emitError(this.serverIoProvider.io, payload)
})
Expand Down Expand Up @@ -527,7 +504,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
})
this.storageService.on(StorageEvents.LOAD_CERTIFICATES, (payload: SendCertificatesResponse) => {
this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CERTIFICATES, payload)
this.registrationService.emit(RegistrationEvents.SET_CERTIFICATES, payload.certificates)
})
this.storageService.on(StorageEvents.LOAD_PUBLIC_CHANNELS, (payload: ChannelsReplicatedPayload) => {
this.serverIoProvider.io.emit(SocketActionTypes.CHANNELS_REPLICATED, payload)
Expand Down Expand Up @@ -582,11 +558,14 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
console.log('emitting deleted channel event back to state manager')
this.serverIoProvider.io.emit(SocketActionTypes.CHANNEL_DELETION_RESPONSE, payload)
})
this.storageService.on(StorageEvents.REPLICATED_CSR, async (payload: string[]) => {
console.log(`On ${StorageEvents.REPLICATED_CSR}`)
this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CSRS, { csrs: payload })
payload.forEach(csr => this.registrationService.emit(RegistrationEvents.REGISTER_USER_CERTIFICATE, csr))
})
this.storageService.on(
StorageEvents.REPLICATED_CSR,
async (payload: { csrs: string[]; certificates: string[] }) => {
console.log(`On ${StorageEvents.REPLICATED_CSR}`)
this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CSRS, { csrs: payload.csrs })
this.registrationService.emit(RegistrationEvents.REGISTER_USER_CERTIFICATE, payload)
}
)
this.storageService.on(StorageEvents.REPLICATED_COMMUNITY_METADATA, (payload: CommunityMetadata) => {
console.log(`On ${StorageEvents.REPLICATED_COMMUNITY_METADATA}: ${payload}`)
const communityMetadataPayload: CommunityMetadataPayload = {
Expand Down
Loading
Loading