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

Preparing for release #2129

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 packages/desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
[unreleased]

* Better descriptions of the joining process

* Update custom deps repositiries (upload-s3-action, ipfs-pubsub-peer-monitor)

* Add certificates validation.

* Move certificates to separate store.

* Move csrs to separate store.

* Fix saveUserCsr saga to trigger only if user csr is absent in user slice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,14 @@ export const BasicMessageComponent: React.FC<BasicMessageProps & FileActionsProp
const userLabel = messageDisplayData?.isDuplicated
? UserLabelType.DUPLICATE
: !messageDisplayData?.isRegistered
? UserLabelType.UNREGISTERED
: null

console.log('Unregistered Debug - Basic Message', { userLabel })
? UserLabelType.UNREGISTERED
: null

const infoMessage = messageDisplayData.type === 3 // 3 stands for MessageType.Info

console.log('Unregistered Debug - Basic Message', { infoMessage })

// Grey out sender name if the first message hasn't been sent yet
const pending: boolean = pendingMessages[messageDisplayData.id] !== undefined

console.log('Unregistered Debug - Basic Message - condition to display label', userLabel && !infoMessage)

return (
<StyledListItem
className={classNames({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ const UserLabel: React.FC<UserLabelProps> = ({
const isUnregistered = type === UserLabelType.UNREGISTERED
const handleOpen = isUnregistered ? unregisteredUsernameModalHandleOpen : duplicatedUsernameModalHandleOpen

console.log('Unregistered Debug - UserLabel Component', { isUnregistered })

return (
<StyledGrid>
<Grid
Expand Down
8 changes: 8 additions & 0 deletions packages/mobile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
[unreleased]

* Better descriptions of the joining process

* Update custom deps repositiries (upload-s3-action, ipfs-pubsub-peer-monitor)

* Add certificates validation.

* Move certificates to separate store.

* Move csrs to separate store.

* Fix saveUserCsr saga to trigger only if user csr is absent in user slice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { expectSaga } from 'redux-saga-test-plan'
import { FactoryGirl } from 'factory-girl'
import { generateMessageFactoryContentWithId, getFactory, identity, publicChannels } from '@quiet/state-manager'
import { setupCrypto } from '@quiet/identity'

import { navigationActions } from '../navigation.slice'
import { ScreenNames } from '../../../const/ScreenNames.enum'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getOldestParsedCerificate } from '../users/users.selectors'
// Workaround for "The inferred type of 'communitiesSelectors' cannot be named without a reference to
// 'packages/identity/node_modules/pkijs/build'. This is likely not portable. A type annotation is necessary."
// https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1270716220
import type { } from 'pkijs'
import type {} from 'pkijs'

const communitiesSlice: CreatedSelectors[StoreKeys.Communities] = (state: StoreState) => state[StoreKeys.Communities]

Expand Down
33 changes: 14 additions & 19 deletions packages/state-manager/src/sagas/users/users.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const allUsers = createSelector(csrsMapping, certificatesMapping, (csrs,
isDuplicated: false,
pubKey,
}
console.log('Unregistered Debug - allUsers selector - certs - user', users[pubKey])
})

Object.keys(csrs).map(pubKey => {
Expand All @@ -105,16 +104,12 @@ export const allUsers = createSelector(csrsMapping, certificatesMapping, (csrs,

const isRegistered = Boolean(certs[pubKey])

console.log('Unregistered Debug - allUsers selector - csrs - certs[pubKey]', certs[pubKey])

users[pubKey] = {
...csrs[pubKey],
isRegistered,
isDuplicated,
pubKey,
}

console.log('Unregistered Debug - allUsers selector - csrs - user', users[pubKey])
})

return users
Expand All @@ -125,20 +120,20 @@ export const getUserByPubKey = (pubKey: string) => createSelector(allUsers, user
export const getOldestParsedCerificate = createSelector(certificates, certs => {
const getTimestamp = (cert: Certificate) => new Date(cert.notBefore.value).getTime()

let certificates: { pubkey: string, certificate: Certificate }[] = []

certificates =
Array.from(Object.entries(certs))
.sort((a, b) => {
const aTimestamp = getTimestamp(a[1])
const bTimestamp = getTimestamp(b[1])
return aTimestamp - bTimestamp
}).map(cert => {
return {
pubkey: cert[0],
certificate: cert[1]
}
})
let certificates: { pubkey: string; certificate: Certificate }[] = []

certificates = Array.from(Object.entries(certs))
.sort((a, b) => {
const aTimestamp = getTimestamp(a[1])
const bTimestamp = getTimestamp(b[1])
return aTimestamp - bTimestamp
})
.map(cert => {
return {
pubkey: cert[0],
certificate: cert[1],
}
})
return certificates[0]
})

Expand Down
Loading