Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop -> staging #4316

Merged
merged 177 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
ccec020
desktop: set 50% minWidth for modals
patosullivan Dec 9, 2024
cec0768
add client support for personal invite links
latter-bolden Dec 9, 2024
a24d867
Delete unused code
davidisaaclee Dec 9, 2024
f8adcd7
Add ActivityEvent type into iOS project
davidisaaclee Dec 9, 2024
dccfe6f
Rename ParseNotificationResult.notify -> .yarn
davidisaaclee Dec 9, 2024
dcf1d58
Pull Yarn -> notification content conversion into protocol
davidisaaclee Dec 9, 2024
bb495e8
find the proper arcane hack the backend will accept
latter-bolden Dec 10, 2024
20f0c49
im sorry, it had to be done
latter-bolden Dec 10, 2024
3bbb65b
copy, fix sigil color in invite display, allow contact overrides in A…
latter-bolden Dec 10, 2024
e975c93
handle personal invite success conditions in boot sequence
latter-bolden Dec 10, 2024
3b57aa2
analytics
latter-bolden Dec 10, 2024
ce7da77
remove more env var passing
latter-bolden Dec 10, 2024
f4fbfc8
cleanup
latter-bolden Dec 10, 2024
df48359
set explicit max/min widths on modals
patosullivan Dec 10, 2024
e9c6fbd
desktop: harden navigation between home/non-home screens and nested s…
patosullivan Dec 10, 2024
fddd597
Merge pull request #4270 from tloncorp/po/tlon-3313-set-larger-min-wi…
patosullivan Dec 10, 2024
cd8206f
update new frontend glob: [skip actions]
invalid-email-address Dec 10, 2024
c78d5b5
Merge branch 'staging' into develop
actions-user Dec 10, 2024
9ed5f49
Update packages/ui/src/components/PersonalInviteButton.tsx
latter-bolden Dec 11, 2024
c9256cc
Merge pull request #4272 from tloncorp/lb/personal-invites
latter-bolden Dec 11, 2024
b04a87d
update glob: [skip actions]
invalid-email-address Dec 11, 2024
57f11d8
update new frontend glob: [skip actions]
invalid-email-address Dec 11, 2024
15021ee
Add dev logger
davidisaaclee Dec 11, 2024
3fd58d5
Add simple handoff when dmPost is provided on notification payload
davidisaaclee Dec 11, 2024
3543868
fixup! f8adcd737
davidisaaclee Dec 11, 2024
cc7cd31
Fetch activity-event in parallel to hark-yarn to facilitate post handoff
davidisaaclee Dec 11, 2024
cfe58f5
desktop: fix ref navigation, fixes TLON-3371
patosullivan Dec 11, 2024
8ada4db
Make posts.synced_at nullable
davidisaaclee Dec 12, 2024
b0e8e74
fix message action height issue
patosullivan Dec 12, 2024
761cd0c
Fix linebreak Swift model (and rename generated model)
davidisaaclee Dec 12, 2024
38c981b
When filtering posts to current window, include unconfirmed posts
davidisaaclee Dec 12, 2024
edaa4ec
Merge pull request #4278 from tloncorp/po/tlon-3375-fix-message-actio…
patosullivan Dec 12, 2024
40202be
Merge pull request #4276 from tloncorp/po/tlon-3306-navigation-fixes-…
patosullivan Dec 12, 2024
7f3ab18
update new frontend glob: [skip actions]
invalid-email-address Dec 12, 2024
587b1b1
ops: bump 5.0.1
latter-bolden Dec 12, 2024
9768cf5
update new frontend glob: [skip actions]
invalid-email-address Dec 12, 2024
0bb23ae
[wip] Hand off data from notif payload to store
davidisaaclee Dec 12, 2024
fd7fef5
[debug] Add globals for accessing database / exec SQL
davidisaaclee Dec 12, 2024
f043eaa
Add queries + hook for working with unconfirmed posts
davidisaaclee Dec 12, 2024
ff1b162
Handoff notif data from presented notifs and newly from tapped notif
davidisaaclee Dec 12, 2024
e17577a
Update getChannelPosts to be aware of unconfirmed posts
davidisaaclee Dec 12, 2024
baa5868
Fetch and insert unconfirmed posts into useChannelPosts results
davidisaaclee Dec 12, 2024
c6d5af1
HACK: Add manual conflict resolution when inserting posts
davidisaaclee Dec 12, 2024
9f09f06
Fix order of inserted unconfirmeds
davidisaaclee Dec 12, 2024
5114fff
Set receivedAt off id (matching other code)
davidisaaclee Dec 12, 2024
bd65762
Remove unnecessary sort
davidisaaclee Dec 12, 2024
1b0617b
Fetch latest post in getUnconfirmedPosts query
davidisaaclee Dec 12, 2024
d7dfd70
Remove unused import
davidisaaclee Dec 13, 2024
5859eca
profile: read contacts fields safely
Fang- Dec 13, 2024
dc2de81
flat group creation (#4253)
dnbrwstr Dec 13, 2024
52a3280
update new frontend glob: [skip actions]
invalid-email-address Dec 13, 2024
828a2e1
update glob: [skip actions]
invalid-email-address Dec 13, 2024
0d145fb
implement drag to upload on desktop (#4282)
dnbrwstr Dec 13, 2024
b77967d
update glob: [skip actions]
invalid-email-address Dec 13, 2024
478f1a3
update new frontend glob: [skip actions]
invalid-email-address Dec 13, 2024
459e5a6
ProfileScreenView: remove old DM lure sharing sheet
jamesacklin Dec 13, 2024
a940742
PersonalInviteSheet: add react-qr-code, display QR code for link
jamesacklin Dec 13, 2024
5b7beb9
Merge pull request #4283 from tloncorp/ja/qr-personal-invite
jamesacklin Dec 13, 2024
8f65908
update new frontend glob: [skip actions]
invalid-email-address Dec 13, 2024
e59ab15
sync: make sure deleted posts get deleted
arthyn Dec 13, 2024
eb4f13c
Fix import
davidisaaclee Dec 13, 2024
0d6a194
Remove debug log
davidisaaclee Dec 13, 2024
c9dcafd
Use getIdParts helper to get author ID
davidisaaclee Dec 13, 2024
697f9bf
Fix MessageKey#id sent parsing
davidisaaclee Dec 13, 2024
89f800b
Remove unnecessary check
davidisaaclee Dec 13, 2024
6698e4a
Merge pull request #4284 from tloncorp/hm/delete-posts
arthyn Dec 13, 2024
6ea17ed
update new frontend glob: [skip actions]
invalid-email-address Dec 13, 2024
c56796a
Merge pull request #4281 from tloncorp/m/profile-contacts-safer
Fang- Dec 13, 2024
d748ddb
fix: check all pages for newest post boundary, fixes TLON-3383
patosullivan Dec 13, 2024
3c77ab0
UserProfileScreenView: theme for background and display name
jamesacklin Dec 16, 2024
9955f0d
ChatListScreen: use primaryActionText color for unopened personal inv…
jamesacklin Dec 16, 2024
40c0f0c
theme: update sticky background colors on several screens
jamesacklin Dec 16, 2024
f151fdd
ProfileStatusSheet: more appropriate send button
jamesacklin Dec 16, 2024
ecc78d6
use kv hooks instead of custom storage setup
latter-bolden Dec 16, 2024
3010d45
help typescript with ColorTokens
latter-bolden Dec 16, 2024
33e8ce6
Merge branch 'staging' into develop
actions-user Dec 16, 2024
a19f3d4
Merge pull request #4288 from tloncorp/ja/color-fixes
jamesacklin Dec 16, 2024
7a7b4f5
update glob: [skip actions]
invalid-email-address Dec 16, 2024
165458e
update new frontend glob: [skip actions]
invalid-email-address Dec 16, 2024
3988032
Pass "is desktop" for all instances of getMainGroupRoute
davidisaaclee Dec 16, 2024
98af164
dont hardcode invite images to 100px
latter-bolden Dec 16, 2024
299508b
show group options in single-channel group channels (#4289)
dnbrwstr Dec 16, 2024
45654b0
Merge pull request #4292 from tloncorp/lb/invite-image-size
latter-bolden Dec 16, 2024
6307037
update new frontend glob: [skip actions]
invalid-email-address Dec 16, 2024
3a69bc7
update new frontend glob: [skip actions]
invalid-email-address Dec 16, 2024
41091d4
Merge remote-tracking branch 'origin/develop' into dil/fix-nav-to-not…
davidisaaclee Dec 16, 2024
8c1600b
Merge pull request #4290 from tloncorp/dil/fix-nav-to-notification
davidisaaclee Dec 16, 2024
0673465
update new frontend glob: [skip actions]
invalid-email-address Dec 16, 2024
4a01774
Fix typo
davidisaaclee Dec 16, 2024
af96ee6
Fix dependencies for useChannelUnconfirmedPosts
davidisaaclee Dec 16, 2024
b621506
Fetch unconfirmed posts once per channel open
davidisaaclee Dec 16, 2024
26429d1
Preserve cursor ID when using it as a window base
davidisaaclee Dec 16, 2024
642225f
privacy: always set secret value and make sure we close sheet
arthyn Dec 16, 2024
7f33127
improve channel load perf (#4291)
dnbrwstr Dec 16, 2024
0cc99a6
update new frontend glob: [skip actions]
invalid-email-address Dec 16, 2024
77b3581
channel-options: use channel volume in channel options
arthyn Dec 16, 2024
7ede66c
Merge pull request #4293 from tloncorp/hm/fix-privacy-selector
arthyn Dec 16, 2024
f456675
ReserveShipScreen: remove unnecessary padding
jamesacklin Dec 16, 2024
2277fff
Merge branch 'develop' into james/tlon-3408-spinning-checkboxes-in-fi…
jamesacklin Dec 16, 2024
88a2a86
Merge pull request #4295 from tloncorp/james/tlon-3408-spinning-check…
jamesacklin Dec 17, 2024
ead0211
update new frontend glob: [skip actions]
invalid-email-address Dec 17, 2024
cc86bc4
prevent race condition on sending a chat message, harden delivery sta…
patosullivan Dec 17, 2024
d31180c
use appropriate cursors, fixes TLON-3328
patosullivan Dec 17, 2024
e247a8d
nav: add missing channelId param, fixes TLON-3401
patosullivan Dec 17, 2024
a415b22
Merge pull request #4294 from tloncorp/hm/fix-channel-notification-se…
arthyn Dec 17, 2024
7bed9ab
update new frontend glob: [skip actions]
invalid-email-address Dec 17, 2024
6ebf1d4
more cursors/userSelect cleanup
patosullivan Dec 17, 2024
3af4e2d
Remove stray log
davidisaaclee Dec 17, 2024
a530ab7
Combine dependent useMemos
davidisaaclee Dec 17, 2024
859bd4f
Add comment explaining why unconfirmed posts are managed separately
davidisaaclee Dec 17, 2024
9ad3193
Move activity-event->post constructors to modelBuilders
davidisaaclee Dec 17, 2024
164b657
more fixes for TLON-3401
patosullivan Dec 17, 2024
db48efb
Add Drizzle issue reference
davidisaaclee Dec 17, 2024
7694078
Merge branch 'develop' into dil/factor-notification-path
davidisaaclee Dec 17, 2024
66fec3a
Merge pull request #4280 from tloncorp/dil/factor-notification-path
davidisaaclee Dec 17, 2024
b187b40
update glob: [skip actions]
invalid-email-address Dec 17, 2024
f703d86
update new frontend glob: [skip actions]
invalid-email-address Dec 17, 2024
ec0e34a
PersonalInviteSheet: layout consistency
jamesacklin Dec 17, 2024
0dd28ab
Button, PersonalInviteButton: consistency with other invite buttons, …
jamesacklin Dec 17, 2024
2f88de3
fix type issues
patosullivan Dec 17, 2024
9201c00
make sure we check both provider and invite service before ever cachi…
latter-bolden Dec 17, 2024
4bbda8b
Merge pull request #4297 from tloncorp/ja/personal-invite-sheet
latter-bolden Dec 17, 2024
ef0eb3c
update new frontend glob: [skip actions]
invalid-email-address Dec 17, 2024
9f2f7f1
lol whooops
latter-bolden Dec 17, 2024
b2a4db9
swap out the value not just the check
latter-bolden Dec 17, 2024
f89939d
Merge pull request #4298 from tloncorp/lb/fix-personal-invites
latter-bolden Dec 18, 2024
58abded
update new frontend glob: [skip actions]
invalid-email-address Dec 18, 2024
a8ab0a2
Remove nested params structure, fix issues with URL paths, fix issue …
patosullivan Dec 18, 2024
402ceb5
remove unused params from parsePathParams
patosullivan Dec 18, 2024
364fe8a
Merge branch 'develop' into po/12-17-desktop-fix-omnibus
patosullivan Dec 18, 2024
226b4a4
Merge pull request #4296 from tloncorp/po/12-17-desktop-fix-omnibus
patosullivan Dec 18, 2024
7945ff7
update new frontend glob: [skip actions]
invalid-email-address Dec 18, 2024
66e3e03
Merge branch 'staging' into sync-dev-12-18
arthyn Dec 18, 2024
9d95e6e
ops: fix new web glob on canary
arthyn Dec 18, 2024
2d75877
Merge pull request #4299 from tloncorp/sync-dev-12-18
arthyn Dec 18, 2024
a9b3d4f
update glob: [skip actions]
invalid-email-address Dec 18, 2024
ae8ae1e
update new frontend glob: [skip actions]
invalid-email-address Dec 18, 2024
b17f605
ops: bump version
latter-bolden Dec 19, 2024
ba393e4
chat input: fix issue with attachments not clearing and input not res…
patosullivan Dec 19, 2024
bd6d406
Merge pull request #4300 from tloncorp/po/tlon-3422-clear-attachments…
patosullivan Dec 19, 2024
7218e00
update new frontend glob: [skip actions]
invalid-email-address Dec 19, 2024
7c7cfdf
load perf analytics (#4301)
dnbrwstr Dec 19, 2024
cf1ae4f
update new frontend glob: [skip actions]
invalid-email-address Dec 19, 2024
8359847
old web: add TM app banner
patosullivan Dec 20, 2024
549e396
make sure it looks good on mobile
patosullivan Dec 20, 2024
d1e1e43
chat input (again): clear attachments and reset input height before send
patosullivan Dec 20, 2024
bbce5ab
Merge pull request #4304 from tloncorp/po/more-chat-input-fiddling
patosullivan Dec 20, 2024
e984204
update new frontend glob: [skip actions]
invalid-email-address Dec 20, 2024
18a5464
switch to useLocalStorage for mobile app banner state
patosullivan Dec 20, 2024
705ecbf
clean up warnings (#4302)
dnbrwstr Dec 20, 2024
c56831d
update glob: [skip actions]
invalid-email-address Dec 20, 2024
902f1f8
update new frontend glob: [skip actions]
invalid-email-address Dec 20, 2024
a5cd486
perf: avoid some unnecessary query invalidations
patosullivan Dec 20, 2024
0a5dbd5
Add specific goBack handler to ChannelScreen, fixes tlon-3417
patosullivan Dec 20, 2024
d7d6855
update useNavigateToPost to handle navigating from activity to a thre…
patosullivan Dec 20, 2024
ee75c44
Merge pull request #4303 from tloncorp/po/tlon-messenger-app-banner-o…
patosullivan Dec 20, 2024
f785610
update glob: [skip actions]
invalid-email-address Dec 20, 2024
a787aa6
actual fix for tlon-3417
patosullivan Dec 20, 2024
578e02d
deeply compare existing and new thread unreads before deciding if the…
patosullivan Dec 20, 2024
a884d99
Merge pull request #4305 from tloncorp/po/perf-avoid-unnecessary-quer…
patosullivan Dec 20, 2024
170da7a
update glob: [skip actions]
invalid-email-address Dec 20, 2024
e53496d
update new frontend glob: [skip actions]
invalid-email-address Dec 21, 2024
85cb119
desktop: bring back leap
patosullivan Jan 6, 2025
25f65fa
Merge pull request #4306 from tloncorp/po/tlon-3417-tlon-3419-nav-issues
patosullivan Jan 7, 2025
7a47d74
Address @latter-bolden feedback
patosullivan Jan 7, 2025
6086994
Fix escape issue in firefox and safari, scroll the list when the user…
patosullivan Jan 7, 2025
9ff7851
Adjust placeholder copy, use Search icon on desktop sidebar to open leap
patosullivan Jan 7, 2025
aac6547
Merge pull request #4310 from tloncorp/po/tlon-3343-bring-back-leap
patosullivan Jan 7, 2025
cb73bb0
update new frontend glob: [skip actions]
invalid-email-address Jan 7, 2025
d4d11c8
remove react-native-storage (#4309)
dnbrwstr Jan 7, 2025
7fdd5ae
update new frontend glob: [skip actions]
invalid-email-address Jan 7, 2025
668a994
update glob: [skip actions]
invalid-email-address Jan 7, 2025
18c864f
modify metro import settings for zustand compat (#4313)
dnbrwstr Jan 7, 2025
d72639b
MobileAppToast: use settings state
jamesacklin Jan 7, 2025
2d67eac
Merge pull request #4315 from tloncorp/ja/hard-dismiss-tm-notice
jamesacklin Jan 7, 2025
b24d40d
update glob: [skip actions]
invalid-email-address Jan 7, 2025
6d6ecac
Merge branch 'staging' into develop
jamesacklin Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ env.tag }}
ssh-key: ${{ secrets.DEPLOY_KEY }}
- uses: actions/download-artifact@v3
with:
name: "ui-dist-new"
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
compileSdk rootProject.ext.compileSdkVersion
versionCode 108
versionName "5.0.0"
versionName "5.0.2"

buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
Expand Down
20 changes: 16 additions & 4 deletions apps/tlon-mobile/ios/Landscape.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
638753092CC7036C003942F5 /* ShortcutsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 638753072CC7036C003942F5 /* ShortcutsManager.swift */; };
63A5A04E2CD05CB900928EED /* ChannelEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A5A04D2CD05CB600928EED /* ChannelEntity.swift */; };
63A5A04F2CD05CB900928EED /* ChannelEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A5A04D2CD05CB600928EED /* ChannelEntity.swift */; };
63CF1DB92D07665B00C0F34E /* ActivityEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF1DB82D07665700C0F34E /* ActivityEvent.swift */; };
63CF1DBA2D07665B00C0F34E /* ActivityEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF1DB82D07665700C0F34E /* ActivityEvent.swift */; };
63CF1DBB2D07665B00C0F34E /* ActivityEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF1DB82D07665700C0F34E /* ActivityEvent.swift */; };
63CF1DBC2D07665B00C0F34E /* ActivityEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF1DB82D07665700C0F34E /* ActivityEvent.swift */; };
63CF1DBD2D07665B00C0F34E /* ActivityEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF1DB82D07665700C0F34E /* ActivityEvent.swift */; };
63E27E0B2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63E27E0A2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift */; };
63E27E0C2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63E27E0A2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift */; };
63E27E0D2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63E27E0A2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift */; };
Expand Down Expand Up @@ -254,6 +259,7 @@
6374ACFC2C4ACD7500E637C0 /* Login.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Login.swift; sourceTree = "<group>"; };
638753072CC7036C003942F5 /* ShortcutsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutsManager.swift; sourceTree = "<group>"; };
63A5A04D2CD05CB600928EED /* ChannelEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelEntity.swift; sourceTree = "<group>"; };
63CF1DB82D07665700C0F34E /* ActivityEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityEvent.swift; sourceTree = "<group>"; };
63E27E0A2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Alamofire+sessionWithSharedCookieStorage.swift"; sourceTree = "<group>"; };
63E27E122C5AF5B8008ACB45 /* HTTPCookieStorage+forwardChanges.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "HTTPCookieStorage+forwardChanges.swift"; path = "Landscape/HTTPCookieStorage+forwardChanges.swift"; sourceTree = "<group>"; };
63EC5CBF2CD049540098C343 /* SQLiteDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLiteDB.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -449,6 +455,7 @@
63E7040D2C540FD6006CF214 /* Models */ = {
isa = PBXGroup;
children = (
63CF1DB82D07665700C0F34E /* ActivityEvent.swift */,
709FC0EC2AC1E25D00B0644D /* Club.swift */,
700B635C2A71DFE90017F40F /* Contact.swift */,
70D3866A2A60A38400AFB46E /* Group.swift */,
Expand Down Expand Up @@ -1217,6 +1224,7 @@
70D3865B2A609BFC00AFB46E /* PocketAPI.swift in Sources */,
70D386582A609BFC00AFB46E /* PushNotificationManager.swift in Sources */,
63E27E0B2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */,
63CF1DBC2D07665B00C0F34E /* ActivityEvent.swift in Sources */,
700B635D2A71DFE90017F40F /* Contact.swift in Sources */,
70EAEAB92A57CE2A00FE96E4 /* UrbitModule.m in Sources */,
70D386672A60A37000AFB46E /* INPerson+Extension.swift in Sources */,
Expand Down Expand Up @@ -1258,6 +1266,7 @@
630DE0CB2C51A8780053603B /* Error+isAFTimeout.swift in Sources */,
630DE0CC2C51A8780053603B /* PushNotificationManager.swift in Sources */,
630DE0CD2C51A8780053603B /* Yarn.swift in Sources */,
63CF1DBA2D07665B00C0F34E /* ActivityEvent.swift in Sources */,
630DE0CE2C51A8780053603B /* GroupChannelStore.swift in Sources */,
63E27E0E2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */,
630DE0CF2C51A8780053603B /* PocketUserAPI.swift in Sources */,
Expand Down Expand Up @@ -1290,6 +1299,7 @@
630DE0B72C51A0F80053603B /* Error+isAFTimeout.swift in Sources */,
632793B62C4ADE9800F942B1 /* PushNotificationManager.swift in Sources */,
632793C22C4AE4FA00F942B1 /* Yarn.swift in Sources */,
63CF1DBD2D07665B00C0F34E /* ActivityEvent.swift in Sources */,
632793C92C4AE7C900F942B1 /* GroupChannelStore.swift in Sources */,
63E27E0D2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */,
632793C62C4AE56F00F942B1 /* PocketUserAPI.swift in Sources */,
Expand Down Expand Up @@ -1324,6 +1334,7 @@
70DBBFF02B7C60B50021EA96 /* PushNotificationManager.swift in Sources */,
63E27E0C2C5AF26C008ACB45 /* Alamofire+sessionWithSharedCookieStorage.swift in Sources */,
70DBBFF12B7C60B50021EA96 /* Contact.swift in Sources */,
63CF1DB92D07665B00C0F34E /* ActivityEvent.swift in Sources */,
70DBBFF22B7C60B50021EA96 /* UrbitModule.m in Sources */,
70DBBFF32B7C60B50021EA96 /* INPerson+Extension.swift in Sources */,
70DBBFF42B7C60B50021EA96 /* Error+logWithDomain.swift in Sources */,
Expand Down Expand Up @@ -1365,6 +1376,7 @@
70F99A9B2B2D336500D77256 /* INPerson+Extension.swift in Sources */,
70F99AAB2B2D337600D77256 /* UserDefaultsStore.swift in Sources */,
70F99A982B2D2B6E00D77256 /* YarnTests.swift in Sources */,
63CF1DBB2D07665B00C0F34E /* ActivityEvent.swift in Sources */,
632793C02C4AE4B500F942B1 /* Error+isAFTimeout.swift in Sources */,
70F99AA92B2D337600D77256 /* GroupChannelStore.swift in Sources */,
70F99A9F2B2D336800D77256 /* Group.swift in Sources */,
Expand Down Expand Up @@ -1427,7 +1439,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1465,7 +1477,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1689,7 +1701,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1732,7 +1744,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
90 changes: 57 additions & 33 deletions apps/tlon-mobile/ios/Notifications/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,40 @@ class NotificationService: UNNotificationServiceExtension {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)

Task { [weak bestAttemptContent] in
let parsedNotification = await PushNotificationManager.parseNotificationUserInfo(request.content.userInfo)
switch parsedNotification {
case let .notify(yarn):
let (mutatedContent, messageIntent) = await PushNotificationManager.buildNotificationWithIntent(
yarn: yarn,
content: bestAttemptContent ?? UNMutableNotificationContent()
)

if let messageIntent {
do {
let interaction = INInteraction(intent: messageIntent, response: nil)
interaction.direction = .incoming
try await interaction.donate()
} catch {
print("Error donating interaction for notification sender details: \(error)")
}
}

contentHandler(mutatedContent)
return

case let .failedFetchContents(err):
packErrorOnNotification(err)
contentHandler(bestAttemptContent!)
return

case .invalid:
fallthrough

case .dismiss:
contentHandler(bestAttemptContent!)
return
Task { [weak bestAttemptContent] in
let parsedNotification = await PushNotificationManager.parseNotificationUserInfo(request.content.userInfo)
switch parsedNotification {
case let .yarn(yarn, activityEvent):
var notifContent = await handle(yarn)
if let activityEvent {
if let dm = activityEvent.dmPost {
let mutableNotifContent = notifContent.mutableCopy() as! UNMutableNotificationContent
// convert to JSON because `userInfo` needs NSSecureCoding
mutableNotifContent.userInfo["dmPost"] = try! dm.asJson()
notifContent = mutableNotifContent
} else if let post = activityEvent.post {
let mutableNotifContent = notifContent.mutableCopy() as! UNMutableNotificationContent
// convert to JSON because `userInfo` needs NSSecureCoding
mutableNotifContent.userInfo["post"] = try! post.asJson()
notifContent = mutableNotifContent
}
}
contentHandler(notifContent)
return

case let .failedFetchContents(err):
packErrorOnNotification(err)
contentHandler(bestAttemptContent!)
return

case .invalid:
fallthrough

case .dismiss:
contentHandler(bestAttemptContent!)
return
}
}
}

/** Appends an error onto the `bestAttemptContent` payload; does *not* attempt to complete the notification request. */
Expand All @@ -61,6 +60,24 @@ class NotificationService: UNNotificationServiceExtension {
contentHandler(bestAttemptContent)
}
}

private func handle(_ renderable: UNNotificationRenderable) async -> UNNotificationContent {
let (mutatedContent, messageIntent) = await renderable.render(
to: bestAttemptContent ?? UNMutableNotificationContent()
)

if let messageIntent {
do {
let interaction = INInteraction(intent: messageIntent, response: nil)
interaction.direction = .incoming
try await interaction.donate()
} catch {
print("Error donating interaction for notification sender details: \(error)")
}
}

return mutatedContent
}
}

extension Error {
Expand All @@ -70,3 +87,10 @@ extension Error {
print(domain, self)
}
}

extension Encodable {
func asJson() throws -> Any {
let data = try JSONEncoder().encode(self)
return try JSONSerialization.jsonObject(with: data, options: [])
}
}
Loading
Loading