Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feeds/navigation
Browse files Browse the repository at this point in the history
* origin/main: (54 commits)
  patch `expo-notifications` to clear badge (#4475)
  Revert to old modal on android (#4458)
  Sort profile feedgens by likes (#4380)
  Revert "Fix undefined block (#4471)" (#4472)
  Fix undefined block (#4471)
  Open convo menu when tapping on chat with deleted account (#4470)
  stop using `addPushTokenListener` (#4467)
  add hitslop to repost button (#4469)
  Add a loading indicator to notifications when loading latest (#4468)
  Visually improve the empty state of feeds (#4466)
  Give a meaningful error in the composer when replying to a deleted post (#4464)
  Fix: show known feed error UI more reliably (#4463)
  Only validate persisted data for existing users (#4465)
  Check `canAskAgain` for notification permissions (#4460)
  Add support for new-tab clicks on feeds (#4462)
  Override legacy language codes for indonesian, hebrew, and yiddish (#4461)
  Ungate mobile web notification badge (#4459)
  Fix (#4430): Use separate hooks for shell mode animated styles (#4451)
  Throttle instead of debounce (#4456)
  debounce refetching listconvos (#4455)
  ...
  • Loading branch information
estrattonbailey committed Jun 11, 2024
2 parents 9a6808f + 808dd35 commit 16d2c7f
Show file tree
Hide file tree
Showing 89 changed files with 17,867 additions and 15,744 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build-submit-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
node-version-file: .nvmrc
cache: yarn

- name: 🪛 Setup jq
uses: dcarbone/install-jq-action@v2

- name: 🔨 Setup EAS
uses: expo/expo-github-action@v8
with:
Expand Down Expand Up @@ -96,13 +99,17 @@ jobs:
name: build-${{ steps.timestamp.outputs.time }}.apk
path: build.apk

- name: 📚 Get version from package.json
id: get-build-info
run: bash scripts/setGitHubOutput.sh

- name: 🔔 Notify Slack of Production Build
if: ${{ inputs.profile == 'production' }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": "Android build is ready for submission. This is a production build! Download the artifact here: ${{ steps.upload-artifact-production.outputs.artifact-url }}"
"text": "Android production build for Google Play Store submission is ready!\n```Artifact: ${{ steps.upload-artifact-production.outputs.artifact-url }}\nVersion Number: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }}\nBuild Number: ${{ steps.get-build-info.outputs.BSKY_ANDROID_VERSION_CODE }}```"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLIENT_ALERT_WEBHOOK }}
Expand Down Expand Up @@ -140,7 +147,7 @@ jobs:
with:
payload: |
{
"text": "Android production APK build is ready for download. This is a production build, and you should add it to the GitHub release! Download the artifact here: ${{ steps.upload-artifact-production-apk.outputs.artifact-url }}"
"text": "Android production build for GitHub/Obtanium is ready!\n```Artifact: ${{ steps.upload-artifact-production-apk.outputs.artifact-url }}\nVersion Number: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }}\nBuild Number: ${{ steps.get-build-info.outputs.BSKY_ANDROID_VERSION_CODE }}```"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLIENT_ALERT_WEBHOOK }}
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/build-submit-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
node-version-file: .nvmrc
cache: yarn

- name: 🪛 Setup jq
uses: dcarbone/install-jq-action@v2

- name: 🔨 Setup EAS
uses: expo/expo-github-action@v8
with:
Expand Down Expand Up @@ -81,6 +84,22 @@ jobs:
- name: 🚀 Deploy
run: eas submit -p ios --non-interactive --path build.ipa

- name: 📚 Get version from package.json
id: get-build-info
run: bash scripts/setGitHubOutput.sh

- name: 🔔 Notify Slack of Production Build
if: ${{ inputs.profile == 'production' }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": "iOS production build for App Store submission is ready!\n```Artifact: Check TestFlight to know when it is available\nVersion Number: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }}\nBuild Number: ${{ steps.get-build-info.outputs.BSKY_IOS_BUILD_NUMBER }}```"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLIENT_ALERT_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

- name: ⬇️ Restore Cache
id: get-base-commit
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion __e2e__/flows/home-screen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ appId: xyz.blueskyweb.app
text: "1"
- tapOn:
id: "repostBtn"
- tapOn: "Undo repost"
- tapOn: "Remove repost"
- assertNotVisible:
id: "repostCount"

Expand Down
31 changes: 0 additions & 31 deletions __e2e__/flows/onboarding-old.yml

This file was deleted.

1 change: 0 additions & 1 deletion app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ module.exports = function (config) {
],
'./plugins/withAndroidManifestPlugin.js',
'./plugins/withAndroidManifestFCMIconPlugin.js',
'./plugins/withAndroidManifestLaunchModePlugin.js',
'./plugins/withAndroidStylesWindowBackgroundPlugin.js',
'./plugins/withAndroidStylesAccentColorPlugin.js',
'./plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js',
Expand Down
30 changes: 22 additions & 8 deletions docs/deploy-ota.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ diff results in incompatible native changes, a new client build will automatical

### Prerequisites

- Remove any internal client from your device and download the client from the App Store/Google Play. This will help for
testing as well as retrieving the build number.
- You should have signed in to EAS locally through npx eas login. You will need to modify the build number in a
subsequent step.
- Identify the build number of the production app you want to deploy an update for. iOS and Android build numbers are
divergent, so you will need to find both
- Find the latest production build number for both iOS and Android in Slack. These are listed in #client-builds
- Production builds always send the Version Number and Build Number in the Slack message. Search for the latest
production version number, and you should find the correct information.

![slack-build-info](./img/slack-build-info.png)

- It may also be useful to check the current production clients for these values. This will also help for testing. Note
that you will need to _fully_ remove the existing internal client build from your device, otherwise the given values in
the app may differ from the actual production values.

![app-build-number](./img/app-build-number.png)

- You should have signed in to EAS locally through npx eas login. You will need to modify the build number in a
subsequent step.
- Ensure that the commit the initial client was cut from is properly tagged in git. The tag should be in the format of 1.X.0
- Note: If the commit is not properly tagged, then the OTA deployment will simply fail since the GitHub Action will
not be able to find a commit to fingerprint and diff against.
Expand All @@ -38,14 +43,17 @@ to create your branch from, this should be properly set.

### Deployment

- Update the build number through EAS
- Update the build number through EAS to match the build numbers of the
production iOS/Android apps
- Note: This isn’t strictly necessary, but having a step that takes you off of GitHub and into the terminal provides
a little “friction” to avoid fat fingering a release. Since there are legitimate reasons to just “click and deploy”
for internal builds, I felt it useful to make sure it doesn’t accidentally become a prod deployment.
- Set the build number to the appropriate build number found in the prerequisite steps. Again, this should be the
- Set the build numbers to the values found in the prerequisite steps. Again, this should be the
build number for the current production release you want to deploy for.
- `npx eas build:version:set -p ios`
- `npx eas build:version:set -p android`
- These steps should spit out what the current build number is, save those values
for later too
- Run the deployment
- Navigate to https://github.com/bluesky-social/social-app/actions/workflows/bundle-deploy-eas-update.yml
- Select the “Run Workflow” dropdown
Expand Down Expand Up @@ -79,3 +87,9 @@ In about five minutes, the new deployment should be available for download. To t
- Launch the app once and wait approximately 15 seconds
- Relaunch the app
- Check the Settings page and scroll to the bottom. The commit hash should now be the latest commit on your deployed branch.

### Post Deployment

- Reset both platforms build numbers to what they were before the OTA
deployment. These values should have been logged by the EAS CLI when you
reset them to the production values prior to OTA.
Binary file added docs/img/slack-build-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion modules/BlueskyNSE/NotificationService.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UserNotifications
import UIKit

let APP_GROUP = "group.app.bsky"

Expand Down Expand Up @@ -31,7 +32,12 @@ class NotificationService: UNNotificationServiceExtension {
}

func mutateWithBadge(_ content: UNMutableNotificationContent) {
content.badge = 1
var count = prefs?.integer(forKey: "badgeCount") ?? 0
count += 1

// Set the new badge number for the notification, then store that value for using later
content.badge = NSNumber(value: count)
prefs?.setValue(count, forKey: "badgeCount")
}

func mutateWithChatMessage(_ content: UNMutableNotificationContent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,9 @@ class ExpoBackgroundNotificationHandlerModule : Module() {
AsyncFunction("removeManyFromStringArrayAsync") { forKey: String, strings: Array<String> ->
NotificationPrefs(appContext.reactContext).removeManyFromStringArray(forKey, strings)
}

AsyncFunction("setBadgeCountAsync") { _: Int ->
// This does nothing on Android
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let DEFAULTS: [String:Any] = [
"playSoundQuote": false,
"playSoundReply": false,
"playSoundRepost": false,
"mutedThreads": [:] as! [String:[String]]
"mutedThreads": [:] as! [String:[String]],
"badgeCount": 0,
]

/*
Expand Down Expand Up @@ -112,5 +113,9 @@ public class ExpoBackgroundNotificationHandlerModule: Module {
userDefaults?.setValue(curr, forKey: forKey)
}
}

AsyncFunction("setBadgeCountAsync") { (count: Int) in
userDefaults?.setValue(count, forKey: "badgeCount")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type ExpoBackgroundNotificationHandlerModule = {
forKey: keyof BackgroundNotificationHandlerPreferences,
value: string[],
) => Promise<void>
setBadgeCountAsync: (count: number) => Promise<void>
}

// TODO there are more preferences in the native code, however they have not been added here yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export const BackgroundNotificationHandler = {
removeFromStringArrayAsync: async (_: string, __: string) => {},
addManyToStringArrayAsync: async (_: string, __: string[]) => {},
removeManyFromStringArrayAsync: async (_: string, __: string[]) => {},
setBadgeCountAsync: async (_: number) => {},
} as ExpoBackgroundNotificationHandlerModule
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bsky.app",
"version": "1.85.0",
"version": "1.86.0",
"private": true,
"engines": {
"node": ">=18"
Expand Down Expand Up @@ -49,7 +49,7 @@
"open-analyzer": "EXPO_PUBLIC_OPEN_ANALYZER=1 yarn build-web"
},
"dependencies": {
"@atproto/api": "^0.12.14",
"@atproto/api": "^0.12.16",
"@bam.tech/react-native-image-resizer": "^3.0.4",
"@braintree/sanitize-url": "^6.0.2",
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
Expand Down Expand Up @@ -116,7 +116,6 @@
"expo-build-properties": "^0.12.1",
"expo-camera": "~15.0.9",
"expo-clipboard": "^6.0.3",
"expo-constants": "~16.0.1",
"expo-dev-client": "^4.0.14",
"expo-device": "~6.0.2",
"expo-file-system": "^17.0.1",
Expand All @@ -129,7 +128,7 @@
"expo-localization": "~15.0.3",
"expo-media-library": "~16.0.3",
"expo-navigation-bar": "~3.0.4",
"expo-notifications": "~0.28.3",
"expo-notifications": "~0.28.7",
"expo-sharing": "^12.0.1",
"expo-splash-screen": "~0.27.4",
"expo-status-bar": "~1.12.1",
Expand Down Expand Up @@ -272,6 +271,8 @@
"resolutions": {
"@types/react": "^18",
"**/zeed-dom": "0.10.9",
"**/expo-constants": "16.0.1",
"**/expo-device": "6.0.2",
"@react-native/babel-preset": "0.74.1"
},
"jest": {
Expand Down
5 changes: 5 additions & 0 deletions patches/expo-modules-core+1.12.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## expo-modules-core Patch

This patch fixes crashes seen in some Android clients when using intents to open the app. See https://github.com/expo/expo/pull/29513.

Do not remove this patch until that PR lands in Expo and is released.
14 changes: 14 additions & 0 deletions patches/expo-modules-core+1.12.11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java b/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java
index bb74e80..0aa0202 100644
--- a/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java
+++ b/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java
@@ -90,8 +90,8 @@ public class NativeModulesProxy extends ReactContextBaseJavaModule {
mModuleRegistry.ensureIsInitialized();

KotlinInteropModuleRegistry kotlinModuleRegistry = getKotlinInteropModuleRegistry();
- kotlinModuleRegistry.emitOnCreate();
kotlinModuleRegistry.installJSIInterop();
+ kotlinModuleRegistry.emitOnCreate();

Map<String, Object> constants = new HashMap<>(3);
constants.put(MODULES_CONSTANTS_KEY, new HashMap<>());
Loading

0 comments on commit 16d2c7f

Please sign in to comment.