Skip to content
Open
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
7 changes: 6 additions & 1 deletion src/store/mainStore/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
const prefixed = (account.personalNamespace && !name.startsWith(account.personalNamespace))
? account.personalNamespace + name
: name
const mailbox = await createMailbox(account.id, prefixed)

Check failure on line 349 in src/store/mainStore/actions.js

View workflow job for this annotation

GitHub Actions / Front-end unit tests

src/tests/unit/store/actions.spec.js > Vuex store actions > adds no prefix to new sub-mailboxes if the account has a personal namespace

AxiosError: Network Error ❯ XMLHttpRequest.handleError node_modules/axios/lib/adapters/xhr.js:122:21 ❯ XMLHttpRequest.invokeTheCallbackFunction node_modules/jsdom/lib/generated/idl/EventHandlerNonNull.js:14:28 ❯ XMLHttpRequest.<anonymous> node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:57:32 ❯ innerInvokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:360:16 ❯ invokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:296:3 ❯ XMLHttpRequestImpl._dispatch node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:243:9 ❯ fireAnEvent node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36 ❯ requestErrorSteps node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:157:3 ❯ dispatchError node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:131:3 ❯ node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:752:13 ❯ Axios.request node_modules/axios/lib/core/Axios.js:46:41 ❯ src/store/mainStore/actions.js:349:21 ❯ handleHttpAuthErrors src/http/sessionExpiryHandler.js:13:10 ❯ src/tests/unit/store/actions.spec.js:123:18 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { description: undefined, number: undefined, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, legacyInterceptorReqResOrdering: true }, adapter: [ 'xhr', 'http', 'fetch' ], transformRequest: [ 'Function<transformRequest>' ], transformResponse: [ 'Function<transformResponse>' ], timeout: +0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: 'Function<FormData>', Blob: 'Function<Blob>' }, validateStatus: 'Function<validateStatus>', headers: { Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/json', requesttoken: '', 'X-Requested-With': 'XMLHttpRequest' }, method: 'post', url: '//index.php/apps/mail/api/mailboxes', data: '{"accountId":13,"name":"INBOX.Archive.2020"}', allowAbsoluteUrls: true }, code: 'ERR_NETWORK', status: undefined }

Check failure on line 349 in src/store/mainStore/actions.js

View workflow job for this annotation

GitHub Actions / Front-end unit tests

src/tests/unit/store/actions.spec.js > Vuex store actions > adds a prefix to new mailboxes if the account has a personal namespace

AxiosError: Network Error ❯ XMLHttpRequest.handleError node_modules/axios/lib/adapters/xhr.js:122:21 ❯ XMLHttpRequest.invokeTheCallbackFunction node_modules/jsdom/lib/generated/idl/EventHandlerNonNull.js:14:28 ❯ XMLHttpRequest.<anonymous> node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:57:32 ❯ innerInvokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:360:16 ❯ invokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:296:3 ❯ XMLHttpRequestImpl._dispatch node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:243:9 ❯ fireAnEvent node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36 ❯ requestErrorSteps node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:157:3 ❯ dispatchError node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:131:3 ❯ node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:752:13 ❯ Axios.request node_modules/axios/lib/core/Axios.js:46:41 ❯ src/store/mainStore/actions.js:349:21 ❯ handleHttpAuthErrors src/http/sessionExpiryHandler.js:13:10 ❯ src/tests/unit/store/actions.spec.js:102:18 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { description: undefined, number: undefined, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, legacyInterceptorReqResOrdering: true }, adapter: [ 'xhr', 'http', 'fetch' ], transformRequest: [ 'Function<transformRequest>' ], transformResponse: [ 'Function<transformResponse>' ], timeout: +0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: 'Function<FormData>', Blob: 'Function<Blob>' }, validateStatus: 'Function<validateStatus>', headers: { Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/json', requesttoken: '', 'X-Requested-With': 'XMLHttpRequest' }, method: 'post', url: '//index.php/apps/mail/api/mailboxes', data: '{"accountId":13,"name":"INBOX.Important"}', allowAbsoluteUrls: true }, code: 'ERR_NETWORK', status: undefined }

Check failure on line 349 in src/store/mainStore/actions.js

View workflow job for this annotation

GitHub Actions / Front-end unit tests

src/tests/unit/store/actions.spec.js > Vuex store actions > creates a sub-mailbox

AxiosError: Network Error ❯ XMLHttpRequest.handleError node_modules/axios/lib/adapters/xhr.js:122:21 ❯ XMLHttpRequest.invokeTheCallbackFunction node_modules/jsdom/lib/generated/idl/EventHandlerNonNull.js:14:28 ❯ XMLHttpRequest.<anonymous> node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:57:32 ❯ innerInvokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:360:16 ❯ invokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:296:3 ❯ XMLHttpRequestImpl._dispatch node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:243:9 ❯ fireAnEvent node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36 ❯ requestErrorSteps node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:157:3 ❯ dispatchError node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:131:3 ❯ node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:752:13 ❯ Axios.request node_modules/axios/lib/core/Axios.js:46:41 ❯ src/store/mainStore/actions.js:349:21 ❯ handleHttpAuthErrors src/http/sessionExpiryHandler.js:13:10 ❯ src/tests/unit/store/actions.spec.js:81:18 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { description: undefined, number: undefined, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, legacyInterceptorReqResOrdering: true }, adapter: [ 'xhr', 'http', 'fetch' ], transformRequest: [ 'Function<transformRequest>' ], transformResponse: [ 'Function<transformResponse>' ], timeout: +0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: 'Function<FormData>', Blob: 'Function<Blob>' }, validateStatus: 'Function<validateStatus>', headers: { Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/json', requesttoken: '', 'X-Requested-With': 'XMLHttpRequest' }, method: 'post', url: '//index.php/apps/mail/api/mailboxes', data: '{"accountId":13,"name":"Archive.2020"}', allowAbsoluteUrls: true }, code: 'ERR_NETWORK', status: undefined }

Check failure on line 349 in src/store/mainStore/actions.js

View workflow job for this annotation

GitHub Actions / Front-end unit tests

src/tests/unit/store/actions.spec.js > Vuex store actions > creates a mailbox

AxiosError: Network Error ❯ XMLHttpRequest.handleError node_modules/axios/lib/adapters/xhr.js:122:21 ❯ XMLHttpRequest.invokeTheCallbackFunction node_modules/jsdom/lib/generated/idl/EventHandlerNonNull.js:14:28 ❯ XMLHttpRequest.<anonymous> node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:57:32 ❯ innerInvokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:360:16 ❯ invokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:296:3 ❯ XMLHttpRequestImpl._dispatch node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:243:9 ❯ fireAnEvent node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36 ❯ requestErrorSteps node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:157:3 ❯ dispatchError node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:131:3 ❯ node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:752:13 ❯ Axios.request node_modules/axios/lib/core/Axios.js:46:41 ❯ src/store/mainStore/actions.js:349:21 ❯ handleHttpAuthErrors src/http/sessionExpiryHandler.js:13:10 ❯ src/tests/unit/store/actions.spec.js:60:18 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { description: undefined, number: undefined, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, legacyInterceptorReqResOrdering: true }, adapter: [ 'xhr', 'http', 'fetch' ], transformRequest: [ 'Function<transformRequest>' ], transformResponse: [ 'Function<transformResponse>' ], timeout: +0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: 'Function<FormData>', Blob: 'Function<Blob>' }, validateStatus: 'Function<validateStatus>', headers: { Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/json', requesttoken: '', 'X-Requested-With': 'XMLHttpRequest' }, method: 'post', url: '//index.php/apps/mail/api/mailboxes', data: '{"accountId":13,"name":"Important"}', allowAbsoluteUrls: true }, code: 'ERR_NETWORK', status: undefined }
logger.debug(`mailbox ${prefixed} created for account ${account.id}`, { mailbox })
this.addMailboxMutation({
account,
Expand Down Expand Up @@ -521,8 +521,13 @@

if (reply.mode === 'reply') {
logger.debug('Show simple reply composer', { reply })
const account = this.getAccount(reply.data.accountId)
let to = original.replyTo !== undefined ? original.replyTo : reply.data.from
if (reply.followUp) {
// Replying to a message we sent ourselves: follow up with the
// original recipient(s) instead of addressing ourselves.
const isOwnMessage = to.length > 0
&& to.every((addr) => addr.email === account.emailAddress)
if (reply.followUp || isOwnMessage) {
to = reply.data.to
}
this.startComposerSessionMutation({
Expand Down
Loading