fix: disable resend button on resending, shorter timeout with UI

pull/3281/head
Audric Ackermann 3 months ago
parent 3a336e83c2
commit 099c9d2b0e
No known key found for this signature in database

@ -234,6 +234,7 @@ const GroupStatusContainer = ({
const ResendButton = ({ groupPk, pubkey }: { pubkey: PubkeyType; groupPk: GroupPubkeyType }) => {
const acceptedInvite = useMemberHasAcceptedInvite(pubkey, groupPk);
const nominatedAdmin = useMemberIsNominatedAdmin(pubkey, groupPk);
const memberStatus = useMemberStatus(pubkey, groupPk);
// as soon as the `admin` flag is set in the group for that member, we should be able to resend a promote as we cannot remove an admin.
const canResendPromotion = hasClosedGroupV2QAButtons() && nominatedAdmin;
@ -252,6 +253,7 @@ const ResendButton = ({ groupPk, pubkey }: { pubkey: PubkeyType; groupPk: GroupP
buttonShape={SessionButtonShape.Square}
buttonType={SessionButtonType.Solid}
text={window.i18n('resend')}
disabled={memberStatus === 'INVITE_SENDING' || memberStatus === 'PROMOTION_SENDING'}
onClick={async () => {
const group = await UserGroupsWrapperActions.getGroup(groupPk);
const member = await MetaGroupWrapperActions.memberGet(groupPk, pubkey);

@ -199,6 +199,7 @@ class GroupInviteJob extends PersistedJob<GroupInvitePersistedData> {
unrevokeSubRequest,
extraStoreRequests: [],
allow401s: false,
timeoutMs: 10 * DURATION.SECONDS,
});
if (sequenceResult !== RunJobResult.Success) {
await LibSessionUtil.saveDumpsToDb(groupPk);
@ -236,7 +237,7 @@ class GroupInviteJob extends PersistedJob<GroupInvitePersistedData> {
message: rawMessage,
isSyncMessage: false,
}),
30 * DURATION.SECONDS,
10 * DURATION.SECONDS,
controller
);

@ -37,6 +37,7 @@ import {
} from '../PersistedJob';
import { DURATION } from '../../../constants';
import { WithAllow401s } from '../../../types/with';
import type { WithTimeoutMs } from '../../../apis/snode_api/requestWith';
const defaultMsBetweenRetries = 15000; // a long time between retries, to avoid running multiple jobs at the same time, when one was postponed at the same time as one already planned (5s)
const defaultMaxAttempts = 2;
@ -91,9 +92,10 @@ async function pushChangesToGroupSwarmIfNeeded({
deleteAllMessagesSubRequest,
extraStoreRequests,
allow401s,
timeoutMs
}: WithGroupPubkey &
WithAllow401s &
WithRevokeSubRequest & {
WithRevokeSubRequest & Partial<WithTimeoutMs> & {
supplementalKeysSubRequest?: StoreGroupKeysSubRequest;
deleteAllMessagesSubRequest?: DeleteAllFromGroupMsgNodeSubRequest;
extraStoreRequests: Array<StoreGroupMessageSubRequest>;
@ -175,7 +177,7 @@ async function pushChangesToGroupSwarmIfNeeded({
abortSignal: controller.signal,
allow401s,
}),
30 * DURATION.SECONDS,
timeoutMs || 30 * DURATION.SECONDS,
controller
);

Loading…
Cancel
Save