refactor(auth): decouple NIP-07 logic and optimize list fetching (agent)

- Moved NIP-07 extension detection and permission logic from `NostrClient` to `nip07` provider.
- Removed redundant `login` method from `NostrClient`.
- Increased concurrency and added timeouts to `fetchListIncrementally` to prevent hanging on slow relays.
- Updated `UserBlocks` to force full fetch on cache miss, fixing "empty list" issues.
- Updated unit tests for login permissions and hashtag preferences to reflect architectural changes.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-26 21:48:52 +00:00
1 parent 967bb079f5
commit 3c7a396da9
6 files changed
+241 -207

No files matched your search

-12
View File
@@ -374,18 +374,6 @@ export default class AuthService {
const detailAuthType =
typeof authType === "string" && authType.trim() ? authType.trim() : "nip07";
if (authType === "nip07") {
const permissionResult = await requestDefaultExtensionPermissions();
if (!permissionResult.ok) {
const error = new Error(
"The NIP-07 extension denied the permission request required to finish logging in.",
);
error.code = "extension-permission-denied";
error.cause = permissionResult.error;
throw error;
}
}
const trimmed = typeof pubkey === "string" ? pubkey.trim() : "";
if (!trimmed) {
return { pubkey: null, providerId, authType: detailAuthType, signer };