-
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 10ce5704b..4a35b48f5 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -90,7 +90,11 @@
"loading": "Loading…",
"generic_error": "An error occured",
"generic_error_message": "An error occured: {0}",
+ "generic_error_details": "Technical info:",
"error_retry": "Please try again",
+ "refresh_required": "Refresh required",
+ "refresh_required_content": "Failed to load UI code. Most likely frontend was updated on server, you'll need to refresh the page.",
+ "refresh_required_refresh": "Refresh page",
"retry": "Try again",
"optional": "optional",
"show_more": "Show more",
@@ -1476,10 +1480,36 @@
"description": "Number of retries for making a connection CONFIRM"
}
},
+ ":hackney_pools": {
+ ":rich_media": {
+ "label": "Rich media",
+ "description": "idk",
+ ":max_connections": {
+ "label": "Max connections",
+ "description": "Number workers in the pool."
+ },
+ ":timeout": {
+ "label": "Timeout",
+ "description": "Timeout while `hackney` will wait for response."
+ }
+ }
+ },
":pools": {
":rich_media": {
"label": "Rich media",
- "description": "idk"
+ "description": "idk",
+ ":size": {
+ "label": "Size",
+ "description": "Maximum number of concurrent requests in the pool."
+ },
+ ":max_waiting": {
+ "label": "Max waiting",
+ "description": "Maximum number of requests waiting for other requests to finish. After this number is reached, the pool will start returning errors when a new request is made"
+ },
+ ":recv_timeout": {
+ "label": "Recv timeout",
+ "description": "Timeout for the pool while gun will wait for response"
+ }
}
},
":rate_limit": {
diff --git a/src/modules/api.js b/src/modules/api.js
index 72d7fb4d7..232d1776d 100644
--- a/src/modules/api.js
+++ b/src/modules/api.js
@@ -302,7 +302,7 @@ const api = {
// Follow requests
startFetchingFollowRequests(store) {
if (store.state.fetchers.followRequests) return
- const fetcher = followRequestFetcher.startFetchingFollowRequests({
+ const fetcher = followRequestFetcher.startFetching({
store,
credentials: useOAuthStore().token,
})
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 445d1d436..5bec225ce 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -883,9 +883,13 @@ const statuses = {
'addNewUsers',
data.statuses.map((s) => s.user).filter((u) => u),
)
- data.statuses = store.commit('addNewStatuses', {
+ store.commit('addNewStatuses', {
statuses: data.statuses,
})
+
+ data.statuses = data.statuses.map(
+ (s) => store.state.allStatusesObject[s.id],
+ )
return data
})
},
diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js
index 2a695f4db..0ea0341e2 100644
--- a/src/services/style_setter/style_setter.js
+++ b/src/services/style_setter/style_setter.js
@@ -8,6 +8,7 @@ import { getEngineChecksum, init } from '../theme_data/theme_data_3.service.js'
import { useMergedConfigStore } from 'src/stores/merged_config.js'
import { useSyncConfigStore } from 'src/stores/sync_config.js'
+import { promisedRequest } from 'src/api/helpers.js'
import { ROOT_CONFIG } from 'src/modules/default_config_state.js'
// On platforms where this is not supported, it will return undefined
@@ -300,7 +301,7 @@ export const applyStyleConfig = (input) => {
adoptStyleSheets()
}
-export const getResourcesIndex = async (url, parser = JSON.parse) => {
+export const getResourcesIndex = async (url, parser = (x) => x) => {
const cache = 'no-store'
const customUrl = url.replace(/\.(\w+)$/, '.custom.$1')
let builtin
@@ -314,10 +315,11 @@ export const getResourcesIndex = async (url, parser = JSON.parse) => {
return [
k,
() =>
- window
- .fetch(v, { cache })
- .then((data) => data.text())
- .then((text) => parser(text))
+ promisedRequest({
+ url: v,
+ cache,
+ })
+ .then(({ data: text }) => parser(text))
.catch((e) => {
console.error(e)
return null
@@ -331,18 +333,19 @@ export const getResourcesIndex = async (url, parser = JSON.parse) => {
}
try {
- const builtinData = await window.fetch(url, { cache })
- const builtinResources = await builtinData.json()
- builtin = resourceTransform(builtinResources)
+ const { data: builtinData } = await promisedRequest({ url, cache })
+ builtin = resourceTransform(builtinData)
} catch {
builtin = []
console.warn(`Builtin resources at ${url} unavailable`)
}
try {
- const customData = await window.fetch(customUrl, { cache })
- const customResources = await customData.json()
- custom = resourceTransform(customResources)
+ const { data: customData } = await promisedRequest({
+ url: customUrl,
+ cache,
+ })
+ custom = resourceTransform(customData)
} catch {
custom = []
console.warn(`Custom resources at ${customUrl} unavailable`)
diff --git a/src/stores/interface.js b/src/stores/interface.js
index 21c1e9f8a..951811c62 100644
--- a/src/stores/interface.js
+++ b/src/stores/interface.js
@@ -58,6 +58,7 @@ export const useInterfaceStore = defineStore('interface', {
},
layoutType: 'normal',
globalNotices: [],
+ globalError: null,
layoutHeight: 0,
lastTimeline: null,
foreignProfileBackground: null,
@@ -176,11 +177,35 @@ export const useInterfaceStore = defineStore('interface', {
removeGlobalNotice(notice) {
this.globalNotices = this.globalNotices.filter((n) => n !== notice)
},
+ setGlobalError({ error, instance, info }) {
+ console.log(info)
+ switch (info) {
+ case 'https://vuejs.org/error-reference/#runtime-13': {
+ this.globalError = {
+ title: 'general.refresh_required',
+ content: 'general.refresh_required_content',
+ // `true` disables cache on Firefox (non-standard)
+ recover: () => window.location.reload(true),
+ recoverText: 'general.refresh_required_refresh',
+ error,
+ }
+ break
+ }
+ default: {
+ this.globalError = { error }
+ break
+ }
+ }
+ console.log(this.globalError)
+ },
+ clearGlobalError() {
+ this.globalError = null
+ },
pushGlobalNotice({
messageKey,
messageArgs = {},
level = 'error',
- timeout = 0,
+ timeout = 5000,
}) {
const notice = {
messageKey,
@@ -193,7 +218,7 @@ export const useInterfaceStore = defineStore('interface', {
// Adding a new element to array wraps it in a Proxy, which breaks the comparison
// TODO: Generate UUID or something instead or relying on !== operator?
const newNotice = this.globalNotices[this.globalNotices.length - 1]
- if (timeout) {
+ if (timeout > 0) {
setTimeout(() => this.removeGlobalNotice(newNotice), timeout)
}
diff --git a/src/sw.js b/src/sw.js
index 1e7abd3de..b7629b5f2 100644
--- a/src/sw.js
+++ b/src/sw.js
@@ -1,5 +1,6 @@
/* eslint-env serviceworker */
+// biome-ignore: side effect import of assets list
import 'virtual:pleroma-fe/service_worker_env'
import { createI18n } from 'vue-i18n'
diff --git a/test/unit/specs/components/draft.spec.js b/test/unit/specs/components/draft.spec.js
index be2400fc3..b69d2323e 100644
--- a/test/unit/specs/components/draft.spec.js
+++ b/test/unit/specs/components/draft.spec.js
@@ -100,7 +100,7 @@ describe('Draft saving', () => {
await textarea.setValue('mew mew')
wrapper.vm.requestClose()
expect(wrapper.vm.$store.getters.draftCount).to.equal(1)
- await waitForEvent(wrapper, 'can-close')
+ await waitForEvent(wrapper, 'close-accepted')
})
it('should save when close if auto-save is off, and unsavedPostAction is save', async () => {
@@ -122,7 +122,7 @@ describe('Draft saving', () => {
await textarea.setValue('mew mew')
wrapper.vm.requestClose()
expect(wrapper.vm.$store.getters.draftCount).to.equal(1)
- await waitForEvent(wrapper, 'can-close')
+ await waitForEvent(wrapper, 'close-accepted')
})
it('should discard when close if auto-save is off, and unsavedPostAction is discard', async () => {
@@ -143,7 +143,7 @@ describe('Draft saving', () => {
const textarea = wrapper.get('textarea')
await textarea.setValue('mew mew')
wrapper.vm.requestClose()
- await waitForEvent(wrapper, 'can-close')
+ await waitForEvent(wrapper, 'close-accepted')
expect(wrapper.vm.$store.getters.draftCount).to.equal(0)
})
@@ -180,6 +180,6 @@ describe('Draft saving', () => {
console.info('clicked')
expect(wrapper.vm.$store.getters.draftCount).to.equal(1)
await flushPromises()
- await waitForEvent(wrapper, 'can-close')
+ await waitForEvent(wrapper, 'close-accepted')
})
})
diff --git a/tools/e2e/run.sh b/tools/e2e/run.sh
index 3c0ba8a36..452302cbd 100644
--- a/tools/e2e/run.sh
+++ b/tools/e2e/run.sh
@@ -5,7 +5,7 @@ set -u
COMPOSE_FILE="docker-compose.e2e.yml"
: "${COMPOSE_MENU:=false}"
-: "${PLEROMA_IMAGE:=git.pleroma.social:5050/pleroma/pleroma:stable}"
+: "${PLEROMA_IMAGE:=git.pleroma.social/pleroma/pleroma:stable}"
: "${E2E_ADMIN_USERNAME:=admin}"
: "${E2E_ADMIN_PASSWORD:=adminadmin}"
: "${E2E_ADMIN_EMAIL:=admin@example.com}"