444 Commits

Author SHA1 Message Date
ekzyis
b1a0abe32c
Service Worker rewrite (#2274)
* Convert all top-level arrow functions to regular functions

* Refactor webPush.sendNotification call

* Refactor webPush logging

* Rename var to title

* Rewrite service worker

This rewrite simplifies the service worker by removing

* merging of push notifications via tag property
* badge count

These features weren't properly working on iOS. We concluded that we don't really need them.

For example, this means replies will no longer get merged to "you have X new replies" but show up as individual notifications.

Only zaps still use the tag property so devices that support it can still replace any previous "your post stacked X sats" notification for the same item.

* Don't use async/await in service worker

* Support app badge count

* Fix extremely slow notificationclick

* Fix serialization and save in pushsubscriptionchange event
2025-07-10 11:54:23 -05:00
ekzyis
bfced699ea
Rename to sendPushSubscriptionReply & remove unused nid argument (#2273)
* Refactor push subscription reply

* Remove unused notification id
2025-07-09 12:50:12 -05:00
ekzyis
3a27057781
Remove service worker logger (#2265)
* Remove service worker logger

* Use async/await for togglePushSubscription

* Remove commented out logger calls in service worker

* Remove message channel between service worker and app

The listener for messages from the service worker was removed in a previous commit.

* Remove unused OS detection for service worker
2025-07-07 14:15:26 -05:00
Bryan Mutai
652315e9a0
Remove defunct relays from default list (#2235)
* Remove defunct relays from default list

* add primal, remove paid relay

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-06-17 18:48:45 -05:00
ekzyis
9dbd9d87d4
Fix error message on content-type mismatch (#2140) 2025-04-28 15:17:44 -05:00
ekzyis
236f930a17
Fix missing method in lnurlp error (#2139) 2025-04-26 14:04:39 -05:00
ekzyis
e8d8e64bfb
Close every relay in every pool (#2130) 2025-04-24 15:47:35 -05:00
ekzyis
eebc791683
Fix push notification sent without own thread subscription (#2123) 2025-04-23 08:37:20 -05:00
Abhi Shandilya
5965b3d090
set boost max (#2109)
* set boost max

* reduce max and apply to boost act

* make boost position aware paid action state

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-04-21 19:31:18 -05:00
Bryan Mutai
ea8a28a23e
feat(socialPoster): add Nostr pubkey tagging with hideNostr check in social poster (#2100)
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-04-21 19:08:21 -05:00
ekzyis
4c2f059fb5
Fix push notifications sent without thread subscription (#2118)
* Fix push notifications sent without thread subscription

* Remove duplicate ancestor check
2025-04-21 16:00:21 -05:00
ekzyis
ff057039f5
Fix unnecessary $queryRawUnsafe and missing await (#2117)
* Fix unnecessary usage of $queryRawUnsafe

* Fix missing await
2025-04-21 10:51:39 -05:00
Bryan Mutai
984790ed5c
feat(Poll): add option to randomize poll choices (#2082)
* feat(Poll): add option to randomize poll choices

* improve

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-04-15 17:19:14 -05:00
ekzyis
1103f04f4b
Check if token expired before refresh (#2101) 2025-04-14 13:46:15 -05:00
soxa
9b73990083
Non-word boundary Regex on user Mentions (#2096)
* fix: non-word boundary regex on user mentions; show user when mentioned with a path

* allow only a single slash after the user
2025-04-12 14:20:01 -05:00
ekzyis
a3e0b6aa9c
Better lightning address error handling (#2089) 2025-04-09 18:11:52 -05:00
ekzyis
52365c32ed
Wallet badges (#2040)
* Remove gun+horse streak

* Add wallet badges

* Fix empty recv wallet detected as enabled

* Resolve badges via columns and triggers

* Fix backwards compatibility by not dropping GQL fields

* Gun+horse notifications as streaks via triggers

* Fix error while computing streaks

* Push notifications for horse+gun

* Move logic to JS via pgboss job

* Fix argument to notifyNewStreak

* Update checkWallet comment

* Refactor notification id hack

* Formatting

* Fix missing update of possibleTypes

This didn't cause any bugs because the added types have no field resolvers.

* Add user migration

* Fix missing cast to date

* Run checkWallet queries inside transaction
2025-04-09 15:29:44 -05:00
ekzyis
40cd0ea422
Fix wrong method in error message (#2065) 2025-04-04 08:03:24 -05:00
k00b
1f5e0833db only use apollo retries if the operation is a query 2025-04-03 11:28:36 -05:00
ekzyis
2cf0f1d268
Update NDK to v2.12.2 (#2041)
* Update NDK to v2.12.2

* Fix NWC with @nostr-dev-kit/ndk-wallet

* Add test for nip-57 zap receipts
2025-04-02 17:20:47 -05:00
ekzyis
88253e5478
external lightning address validator (#2056) 2025-04-01 17:39:33 -05:00
ekzyis
5700a4090a
Fix FAQ hydration error (#2050) 2025-04-01 16:18:25 -05:00
ekzyis
fca4d1ff92
Include name in mention push notification (#2045) 2025-03-31 11:59:57 -05:00
ekzyis
de7f96a3a4
Merge follow-up replies with normal replies (#2027) 2025-03-26 11:00:04 -05:00
ekzyis
e29c6b4842
Refactor reminder push notifications (#2026)
* Refactor reminder push notifications

items should always exist and if not, we can just immediately fail imo

* Use same text for reminders in /notifications
2025-03-26 10:59:27 -05:00
ekzyis
ef8c738582
Reset multi_auth to initial state on error (#2007)
* Reset multi auth to initial state

* Also check if next-auth.session-token exists

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-03-25 18:59:26 -05:00
ekzyis
df17bc3b25
Use MULTI_AUTH_REGEXP to test for multi auth keys (#2020) 2025-03-25 12:25:55 -05:00
ekzyis
04a4092090
Reset if pointer is not a number or JWT cannot be decoded (#2021) 2025-03-25 12:25:37 -05:00
ekzyis
e7eece744f
Use __Secure- cookie prefix (#1998) 2025-03-22 16:59:57 -05:00
ekzyis
5ff1334722
Remove unnecessary exports (#2006) 2025-03-21 19:56:01 -05:00
ekzyis
5e2185c18f
Use cookieOptions for pointer cookie (#2005) 2025-03-21 19:53:49 -05:00
ekzyis
a83783f008
Fix missing max-age cookie option (#2000) 2025-03-20 16:38:13 -05:00
ekzyis
74d99e9b74
Reset multi_auth cookies on error (#1957)
* multi_auth cookies check + reset

* multi_auth cookies refresh

* Expire cookies after 30 days

This is the actual default for next-auth.session-token.

* Collapse issues by default

* Only refresh session cookie manually as anon

* fix mangled merge

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-03-19 18:54:43 -05:00
ekzyis
c492618d31
Fix weeks not support in reminder command (#1977) 2025-03-17 13:15:09 -05:00
k00b
8eb5a51fd6 move sanctioned country codes to env var 2025-03-03 18:14:36 -06:00
Edward Kung
73170ba8a2
Territory analytics (#1926)
* add territory to analytics selectors

* implement territory analytics, revert user satistics header

* fix linting errors

* disallow some territory names

* fix linting error

* minor adjustments to header

* escape input

* 404 on non-existant sub

* exclude unused queries depending on sub select

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-28 19:15:18 -06:00
Scroogey-SN
b6618dd66a
Fix issue #1924, require nostr prefixes start with slash (#1928) 2025-02-27 15:24:09 -06:00
Scroogey-SN
f97c1b04e6
Fix issue #1905, item popover with commentId (#1911)
* Fix issue #1905, item popover with commentId

* Fix issue #1924, require nostr prefixes start with slash

* revert hacks and unrelated changes, use commentId in rehype

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-27 13:10:42 -06:00
k00b
31b58baf51 decrease nofollow limit 2025-02-23 11:08:05 -06:00
ekzyis
0032e064b2
Automated retries (#1776)
* Poll failed invoices with visibility timeout

* Don't return intermediate failed invoices

* Don't retry too old invoices

* Retry invoices on client

* Only attempt payment 3 times

* Fix fallbacks during last retry

* Rename retry column to paymentAttempt

* Fix no index used

* Resolve TODOs

* Use expiring locks

* Better comments for constants

* Acquire lock during retry

* Use expiring lock in retry mutation

* Use now() instead of CURRENT_TIMESTAMP

* Cosmetic changes

* Immediately show failed post payments in notifications

* Update hasNewNotes

* Never retry on user cancel

For a consistent UX and less mental overhead, I decided to remove the exception for ITEM_CREATE where it would still retry in the background even though we want to show the payment failure immediately in notifications.

* Fix notifications without pending retries missing if no send wallets

If a stacker has no send wallets, they would miss notifications about failed payments because they would never get retried.

This commit fixes this by making the notifications query aware if the stacker has send wallets. This way, it can tell if a notification will be retried or not.

* Stop hiding userCancel in notifications

As mentioned in a previous commit, I want to show anything that will not be attempted anymore in notifications.

Before, I wanted to hide manually cancelled invoices but to not change experience unnecessarily and to decrease mental overhead, I changed my mind.

* Also consider invoice.cancelledAt in notifications

* Always retry failed payments, even without send wallets

* Fix notification indicator on retry timeout

* Set invoice.updated_at to date slightly in the future

* Use default job priority

* Stop retrying after one hour

* Remove special case for ITEM_CREATE

* Replace retryTimeout job with notification indicator query

* Fix sortTime

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-02-14 19:25:11 -06:00
Edward Kung
15bd1c3fc5
Fix the check for misleading links (#1901)
* Fix the check for misleading links

* replace tabs with spaces

* remove trailing spaces

* move isMisleadingLinks to lib/url.js and create unit tests

* Add comments to test cases

* URLs can contain hyphens

---------

Co-authored-by: ekzyis <ek@stacker.news>
2025-02-14 09:43:08 -06:00
ekzyis
77781e07ed
Don't parse content in code blocks (#1899) 2025-02-13 11:46:53 -06:00
k00b
bdd87e7d39 add retry link back 2025-02-11 16:29:37 -06:00
soxa
e6081ebef3
fix: THREAD notification type for noteAllDescendants (#1894)
* THREAD notifications to distinguish direct replies from follow-ups

* hotfix: typo

* hotfix: avoid subquery when we already have a JOIN
2025-02-11 13:45:04 -06:00
soxa
5c2aa979ea
feat: comment fee control (#1768)
* feat: comment fee control

* update typeDefs for unarchiving territories

* review: move functions to top level; consider saloon items

* ux: cleaner post/reply cost section

* hotfix: handle salon replies

* bios don't have subs + simplify root query

* move reply cost to accordian

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-07 13:38:57 -06:00
soxa
be7c702602
Login with magic code (#1818)
* fix: cannot login with email on PWA

* adjust other email templates

* restore manual url on new user email

* no padding on button section

* cleanup

* generate 6-digit bechh32 token

* token needs to be fed as lower case; validator case insensitive

* delete token if user has failed 3 times

* proposal: context-independent error page

* include expiration time on email page message

* add expiration time to emails

* independent checkPWA function

* restore token deletion if successful auth

* final cleanup: remove unused function

* compact useVerificationToken

* email.js: magic code for non-PWA users

* adjust email templates

* MultiInput component; magic code via MultiInput

* hotfix: revert length testing; larger width for inputs

* manual bech32 token generation; no upperCase

* reverting to string concatenation

* layout tweaks, fix error placement

* pastable inputs

* small nit fixes

* less ambiguous error path

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-03 18:41:01 -06:00
k00b
efdcbef733 fixes related to comment paging 2025-01-30 19:19:49 -06:00
Keyan
01b021a337
comment pagination with limit/offset (#1824)
* basic query with limit/offset

* roughly working increment

* working limiting/pageable queries

* denormalize direct comments + full comments below threshold

* notifications in megathread + working nest view more buttons

* fix empty comment footer

* make comments nested resolver again

* use time in cursor to avoid duplicates

* squash migrations

* do not need item.comments undefined checks
2025-01-29 19:00:05 -06:00
ekzyis
c023e8d7d5
Fix missing push notifications for thread subscriptions (#1843)
* Fix missing push notifications for thread subscriptions

* Filter by comments in calling context

* Fix mutes not considered

* Fix duplicate push notification (reply+thread subscription) sent
2025-01-25 13:47:58 -06:00
soxa
ae1942ada7
fix: duplicate push notification on subscribed user and territory (#1820)
* fix: duplicate notification on subscribed user and territory

* fix comments not showing up, adjust query

* use  and tagged template helpers

---------

Co-authored-by: k00b <k00b@stacker.news>
2025-01-22 16:12:41 -06:00