fix: user profile image upload issue#369
Conversation
|
@wolgwang1729 is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes the user profile image upload flow to prevent UI reversion and improve resilience across different Blossom server response formats.
Changes:
- Normalizes Blossom upload responses (top-level vs NIP-94 tags) and adds URL fallback construction from SHA-256 when needed.
- Hardens profile form numeric input stringification and prevents stale context-driven resets.
- Improves file uploader reliability (loading state, filtering upload results) and prevents accidental form submission during uploads.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| utils/nostr/nostr-helper-functions.ts | Normalizes Blossom responses and adds URL fallback + clearer error when URL can’t be resolved. |
| pages/settings/user-profile.tsx | Guards repeated form resets and hardens numeric input value conversion. |
| components/utility-components/file-uploader.tsx | Improves loading behavior, prevents accidental submit, and swaps to native file input. |
| components/settings/user-profile-form.tsx | Hardens numeric input value conversion. |
Comments suppressed due to low confidence (1)
components/utility-components/file-uploader.tsx:1
.filter((url) => Boolean(url))doesn’t provide TypeScript narrowing (unlike a type-predicate), so the resulting array type may remain a union (e.g.,(string | null)[]). If later code expectsstring[], prefer a type guard filter such as(url): url is string => typeof url === \"string\" && url.length > 0(or at leasturl != null) to keep type safety.
import { useContext, useRef, useState } from "react";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
can u solve the conflict? |
833e2c9 to
e4d73ee
Compare
GautamBytes
left a comment
There was a problem hiding this comment.
pages/settings/user-profile.tsx still does DB-first hydration and writes back created_at: 0, and the new contextLoadedRef can block fresher profileContext updates after that. Please switch this page to the same timestamped recency/local-fallback logic as components/settings/user-profile-form.tsx so stale data can’t win after an image upload.
|
Great catch! I initially held off on changing the hydration approach in I've now refactored both |
|
LGTM Now!! |
Description
value?.toString() || ""in both profile form implementations.type="button".Inputwith nativeinputfor file selection to avoid controlled file input conflicts.nip94_event.tagsresponses.if (contextLoadedRef.current) return;.Screenshots (if applicable)
Previous Error:

After Fix:
Shopstr.Bitcoin-Native.Nostr.Marketplace.Shop.Freely.-.Google.Chrome.-.8.April.2026_blurred.mp4
Affirmation