memi-board 0.52.3 → 0.52.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/components/ProfileEditModal.vue +3 -1
- package/docs/firebase-setup.md +64 -0
- package/docs/host-integration.md +4 -0
- package/package.json +1 -1
|
@@ -69,7 +69,9 @@ async function updateProfileReferences(nextName: string, nextPhotoURL: string |
|
|
|
69
69
|
const [postsSnapshot, commentsSnapshot, repliesSnapshot] = await Promise.all([
|
|
70
70
|
getDocs(query(postsCol(db, config), where('authorUid', '==', props.uid))),
|
|
71
71
|
getDocs(query(commentsCol(db, config), where('authorUid', '==', props.uid))),
|
|
72
|
-
|
|
72
|
+
// Rules can only allow this list for regular users when listed==true is pinned in the query.
|
|
73
|
+
// Reply-target names on hidden boards are not updated.
|
|
74
|
+
getDocs(query(commentsCol(db, config), where('replyToUid', '==', props.uid), where('listed', '==', true))),
|
|
73
75
|
])
|
|
74
76
|
|
|
75
77
|
// 한 댓글이 작성자이면서 답글 대상일 수도 있으므로 같은 문서의 변경을 합친다.
|
package/docs/firebase-setup.md
CHANGED
|
@@ -175,3 +175,67 @@ firebase deploy --only firestore:indexes
|
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
If a console error shows an index creation link, you can follow it too — the example file above is prepared in advance based on the queries the package actually runs. If you customized collection names (`memiBoard.postsCollection`, etc.), update the `collectionGroup` values to match.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## Safari: slow post navigation or delayed comments
|
|
181
|
+
|
|
182
|
+
On some macOS Safari and iPhone/iPad browser environments, Firestore reads and realtime updates can stall for about **30 seconds** while Chrome on macOS responds normally. Symptoms include a skeleton that stays visible after Previous/Next navigation, delayed comments, and late like/report state updates. Sequential reads can make the visible delay approach a minute. Both `getDocs()` and `onSnapshot()` can be affected; switching from VueFire to direct Firebase calls does not necessarily avoid it.
|
|
183
|
+
|
|
184
|
+
If you reproduce this pattern, **the host app may need to force Firestore long polling for the affected browsers**. memi-board uses the host's Firestore instance and does not change its transport automatically. Updating memi-board alone does not enable this setting.
|
|
185
|
+
|
|
186
|
+
### Evidence and limits
|
|
187
|
+
|
|
188
|
+
In local testing on 2026-10-30 with Firebase JS SDK 12.19.0, VueFire 3.2.3, and nuxt-vuefire 1.1.2:
|
|
189
|
+
|
|
190
|
+
- Mac Safari reported post/comment reads and auxiliary subscriptions completing after roughly 29.9–30.2 seconds. Omitting like/report subscriptions still left a post lookup stalled for 30.1 seconds.
|
|
191
|
+
- With all subscriptions enabled and forced long polling, five round trips between the same two posts did not reproduce the 30-second stalls. Initial server reads took roughly 0.1–0.7 seconds; later subscription callbacks could use cached data.
|
|
192
|
+
- The tester also confirmed improvement on iPhone Safari. This is evidence for a transport compatibility problem in the tested environments, not a guarantee for every Safari version or every loading failure.
|
|
193
|
+
|
|
194
|
+
Related reports and API details: [Firebase JS SDK issue #9789](https://github.com/firebase/firebase-js-sdk/issues/9789), [WebKit streaming regression #322545](https://bugs.webkit.org/show_bug.cgi?id=322545), and [FirestoreSettings](https://firebase.google.com/docs/reference/js/firestore.firestoresettings). A WebKit source fix does not by itself establish which installed Safari versions include it. Recheck the actual devices before removing a host workaround.
|
|
195
|
+
|
|
196
|
+
### Nuxt / VueFire host configuration
|
|
197
|
+
|
|
198
|
+
Create the following **client-only host plugin**, or merge the settings into the host's existing early Firestore initialization. It must run **before any `getFirestore()`, `useFirestore()`, Firestore read, or subscription**. Do not put it in a page's `onMounted()` hook. The early order also precedes the standard nuxt-vuefire app plugin; if your host has an earlier custom Firebase plugin, coordinate its initialization instead of initializing Firestore twice with different settings.
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
// app/plugins/00.firestore-transport.client.ts
|
|
202
|
+
import { initializeApp, type FirebaseOptions } from 'firebase/app'
|
|
203
|
+
import { initializeFirestore } from 'firebase/firestore'
|
|
204
|
+
|
|
205
|
+
export default defineNuxtPlugin({
|
|
206
|
+
name: 'host-firestore-transport',
|
|
207
|
+
order: -100,
|
|
208
|
+
setup() {
|
|
209
|
+
const ua = navigator.userAgent
|
|
210
|
+
const isIOSOrIPadOS = /iPad|iPhone|iPod/.test(ua)
|
|
211
|
+
|| (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
|
|
212
|
+
const isSafari = /Safari/i.test(ua)
|
|
213
|
+
&& !/Chrome|Chromium|CriOS|Edg|OPR|FxiOS|Android/i.test(ua)
|
|
214
|
+
if (!isIOSOrIPadOS && !isSafari) return
|
|
215
|
+
|
|
216
|
+
// Reuse exactly the same web app config as nuxt-vuefire.
|
|
217
|
+
const { config } = useRuntimeConfig().public.vuefire as {
|
|
218
|
+
config: FirebaseOptions
|
|
219
|
+
}
|
|
220
|
+
const app = initializeApp(config)
|
|
221
|
+
initializeFirestore(app, {
|
|
222
|
+
experimentalAutoDetectLongPolling: false,
|
|
223
|
+
experimentalForceLongPolling: true,
|
|
224
|
+
})
|
|
225
|
+
},
|
|
226
|
+
})
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
This example targets Safari and iOS/iPadOS browser user agents, including desktop-style iPad user agents. Browser detection is a heuristic: adapt it to the devices and engines your service actually supports. The code assumes the default Firebase app/database used by the host's standard nuxt-vuefire setup; named apps or databases must initialize their matching instance instead. Keep it client-only so it does not change the server's Admin SDK configuration.
|
|
230
|
+
|
|
231
|
+
Automatic long-polling detection is already enabled by default in recent Firebase JS SDKs; explicitly setting `experimentalAutoDetectLongPolling: true` alone is not the same experiment. The example disables auto-detection and forces long polling. Firestore documents a possible performance cost, so compare on the affected devices and avoid enabling it for every browser without evidence. Realtime subscriptions continue to work; there is no need to remove comments or likes subscriptions to use this transport.
|
|
232
|
+
|
|
233
|
+
### Verify the change
|
|
234
|
+
|
|
235
|
+
1. Before changing transport, measure slug-to-ID lookup, post metadata/body readiness, initial comment reads, and first realtime callbacks separately. Distinguish cached callbacks from server reads.
|
|
236
|
+
2. Apply the host plugin and fully reload the page. Transport settings cannot be switched on an already-running Firestore instance using hot reload alone.
|
|
237
|
+
3. On both Mac and iPhone Safari, navigate Previous/Next repeatedly through the same posts and additional uncached posts. Compare server-read timings against the default configuration.
|
|
238
|
+
4. Use another browser to add a comment and toggle a like, then check that Safari receives the updates. Also check reconnecting after backgrounding and restoring the app.
|
|
239
|
+
5. If long polling does not improve the result, investigate authentication/App Check readiness, offline state, permissions, missing indexes, and application errors separately. A loading skeleton is not proof of this specific transport issue.
|
|
240
|
+
|
|
241
|
+
No Firebase rule or index deployment is needed for this transport setting. Deploy the plugin with the **host app**, then have existing tabs reload. Temporary diagnostic panels and test switches are not part of the package.
|
package/docs/host-integration.md
CHANGED
|
@@ -72,6 +72,10 @@ Use the **Firebase web app config of the site you are adding the board to**. Sto
|
|
|
72
72
|
|
|
73
73
|
Keep SSR for the public list and detail pages. Even with `moderation.enabled: false`, the default local banned-word check remains. This config has no option to turn off the writing AI's proofreading and sentence polishing; using those AI menus requires an AI Logic connection.
|
|
74
74
|
|
|
75
|
+
### Safari Firestore transport compatibility
|
|
76
|
+
|
|
77
|
+
If Mac or iPhone Safari keeps showing a loading skeleton after post navigation, or comments/realtime state arrive roughly 30 seconds late while macOS Chrome is fast, the host may need **forced Firestore long polling**. Configure it before VueFire first uses Firestore; installing or upgrading memi-board does not change the host transport. See [Safari symptoms, the early Nuxt plugin, and verification steps](firebase-setup.md#safari-slow-post-navigation-or-delayed-comments).
|
|
78
|
+
|
|
75
79
|
## 4. Styles and UApp
|
|
76
80
|
|
|
77
81
|
```css
|