fix: manage pending relay connection requests #159

Merged
eugene merged 6 commits from reduce-relay-connection-attempts into staging 2024-08-21 08:06:39 +00:00
Owner

Also remove the getMostPopularRelays function and use a hardcoded list of relays
Further, if metadata event is not found from relays cache an empty metadata for that pubkey

Also remove the getMostPopularRelays function and use a hardcoded list of relays Further, if metadata event is not found from relays cache an empty metadata for that pubkey
s added 1 commit 2024-08-20 19:17:08 +00:00
fix: manage pending relay connection requests
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 34s
f9fcfb1c9e
Also remove the getMostPopularRelays function and use a hardcoded list of relays
Further, if metadata event is not found from relays cache an empty metadata for that pubkey
s added 1 commit 2024-08-20 19:34:49 +00:00
chore: quick fix
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
2c18c51029
s added 1 commit 2024-08-20 19:43:53 +00:00
fix: in pdf marking if counterpart does not have any of name, displayname, username then show pubkey
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
42d74c656a
eugene reviewed 2024-08-21 06:35:36 +00:00
@ -15,3 +14,2 @@
*/
export const ONE_WEEK_IN_MS: number = 604800000
export const SIGIT_RELAY: string = 'wss://relay.sigit.io'
export const ONE_WEEK_IN_MS = 7 * 24 * 60 * 60 * 1000
Owner

Why do you need to calculate this constant instead of providing a defined value?

Why do you need to calculate this constant instead of providing a defined value?
Owner

I guess this avoids any uncertainty about how the number was calculated, or if it was calculated correctly. It's a one time operation right?

I guess this avoids any uncertainty about how the number was calculated, or if it was calculated correctly. It's a one time operation right?
Author
Owner

yes, its one time.

yes, its one time.
s marked this conversation as resolved
eugene reviewed 2024-08-21 06:40:41 +00:00
@ -132,3 +118,3 @@
if (cachedMetadataEvent) {
// Check if the cached metadata is older than one week
if (isOlderThanOneWeek(cachedMetadataEvent.cachedAt)) {
if (isOlderThanOneDay(cachedMetadataEvent.cachedAt)) {
Owner

There is a discrepancy between the function name and the comments around it. Should it be older than one week or one day?

There is a discrepancy between the function name and the comments around it. Should it be older than one week or one day?
Author
Owner

fixed, Updated comment

fixed, Updated comment
s marked this conversation as resolved
eugene reviewed 2024-08-21 06:43:18 +00:00
@ -196,6 +156,7 @@ const getRelayMap = async (
})
Object.keys(relaysMap).forEach((relayUrl) => {
console.log('being called from getRelayMap')
Owner

Should this console log be removed?

Should this console log be removed?
Author
Owner

removed

removed
s marked this conversation as resolved
eugene reviewed 2024-08-21 06:43:51 +00:00
@ -256,3 +217,3 @@
// If relay map is empty, use most popular relay URIs
if (!relaysToPublish.length) {
relaysToPublish = await getMostPopularRelays()
relaysToPublish = DEFAULT_LOOK_UP_RELAY_LIST
Owner

Should DEFAULT_LOOK_UP_RELAY_LIST be copied rather than re-assigned?

Should `DEFAULT_LOOK_UP_RELAY_LIST` be copied rather than re-assigned?
Author
Owner

Its fine here because we're not updating the relaysToPublish array after this assignment in this function (which would have caused side effects on DEFAULT_LOOK_UP_RELAY_LIST).
Further I'm handling the case where I need to append the array by copying the array in the relay controller.

Its fine here because we're not updating the relaysToPublish array after this assignment in this function (which would have caused side effects on DEFAULT_LOOK_UP_RELAY_LIST). Further I'm handling the case where I need to append the array by copying the array in the relay controller.
s marked this conversation as resolved
s added 1 commit 2024-08-21 07:42:15 +00:00
chore: addressed PR comments
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
4a553c047c
b added 1 commit 2024-08-21 07:42:46 +00:00
Merge branch 'staging' into reduce-relay-connection-attempts
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
c1b1c5a075
s added 1 commit 2024-08-21 07:53:30 +00:00
fix: use default relayMap if its undefined in redux store
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
d7b5ea9b9e
eugene merged commit 35f6a639e6 into staging 2024-08-21 08:06:39 +00:00
eugene deleted branch reduce-relay-connection-attempts 2024-08-21 08:06:39 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sigit/sigit.io#159
No description provided.