Skip to content

Commit 08d447c

Browse files
Merge branch 'main' of github.com:Expensify/App into aldo_ignore-has-outstanding-iou-child-report
2 parents 43f38fb + 8472f03 commit 08d447c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+902
-407
lines changed

.github/workflows/platformDeploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777

7878
- name: Upload Android version to Browser Stack
7979
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
80-
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@./android/app/build/outputs/bundle/release/app-release.aab"
80+
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@./android/app/build/outputs/bundle/productionRelease/app-production-release.aab"
8181
env:
8282
BROWSERSTACK: ${{ secrets.BROWSERSTACK }}
8383

android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ android {
9090
minSdkVersion rootProject.ext.minSdkVersion
9191
targetSdkVersion rootProject.ext.targetSdkVersion
9292
multiDexEnabled rootProject.ext.multiDexEnabled
93-
versionCode 1001035401
94-
versionName "1.3.54-1"
93+
versionCode 1001035409
94+
versionName "1.3.54-9"
9595
}
9696

9797
flavorDimensions "default"
@@ -136,7 +136,7 @@ android {
136136
signingConfig signingConfigs.debug
137137
}
138138
release {
139-
signingConfig signingConfigs.debug
139+
signingConfig signingConfigs.release
140140
productFlavors.production.signingConfig signingConfigs.release
141141
minifyEnabled enableProguardInReleaseBuilds
142142
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

assets/images/lounge-access.svg

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<search_restrict_args lr="" cr="" gl="" filter="0" sort="" as_siteseach="" as_oq=""></search_restrict_args>
2626
</image_advanced_options>
2727
<search_options link_target=""></search_options>
28-
<custom_search_control_options no_results_string="Upps no results found, Please try again..."></custom_search_control_options>
28+
<custom_search_control_options no_results_string="Oops no results found, Please try again..."></custom_search_control_options>
2929
</cse_advance_settings>
3030
<sort_by_keys label="Relevance" key=""></sort_by_keys>
3131
<sort_by_keys label="Date" key="date"></sort_by_keys>

fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ platform :android do
7878
upload_to_play_store(
7979
package_name: "com.expensify.chat",
8080
json_key: './android/app/android-fastlane-json-key.json',
81-
aab: './android/app/build/outputs/bundle/release/app-release.aab',
81+
aab: './android/app/build/outputs/bundle/productionRelease/app-production-release.aab',
8282
track: 'internal',
8383
rollout: '1.0'
8484
)

ios/NewExpensify.xcodeproj/xcshareddata/xcschemes/New Expensify.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</Testables>
7676
</TestAction>
7777
<LaunchAction
78-
buildConfiguration = "Debug Production"
78+
buildConfiguration = "Release Production"
7979
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
8080
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
8181
launchStyle = "0"
@@ -117,6 +117,7 @@
117117
</AnalyzeAction>
118118
<ArchiveAction
119119
buildConfiguration = "Release Production"
120+
customArchiveName = "New Expensify"
120121
revealArchiveInOrganizer = "YES">
121122
</ArchiveAction>
122123
</Scheme>

ios/NewExpensify/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</dict>
3333
</array>
3434
<key>CFBundleVersion</key>
35-
<string>1.3.54.1</string>
35+
<string>1.3.54.9</string>
3636
<key>ITSAppUsesNonExemptEncryption</key>
3737
<false/>
3838
<key>LSApplicationQueriesSchemes</key>

ios/NewExpensifyTests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.3.54.1</string>
22+
<string>1.3.54.9</string>
2323
</dict>
2424
</plist>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "1.3.54-1",
3+
"version": "1.3.54-9",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
diff --git a/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js b/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
2+
index 16fdbef..bc2c96a 100644
3+
--- a/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
4+
+++ b/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
5+
@@ -1,8 +1,23 @@
6+
import { nanoid } from 'nanoid/non-secure';
7+
+import { findFocusedRouteKey } from './findFocusedRouteKey';
8+
export default function createMemoryHistory() {
9+
let index = 0;
10+
let items = [];
11+
-
12+
+ const log = () => {
13+
+ console.log(JSON.stringify({
14+
+ index,
15+
+ indexGetter: history.index,
16+
+ items: items.map((item, i) => {
17+
+ var _item$state;
18+
+ return {
19+
+ selected: history.index === i ? '<<<<<<<' : undefined,
20+
+ path: item.path,
21+
+ id: item.id,
22+
+ state: ((_item$state = item.state) === null || _item$state === void 0 ? void 0 : _item$state.key) || null
23+
+ };
24+
+ })
25+
+ }, null, 4));
26+
+ };
27+
// Pending callbacks for `history.go(n)`
28+
// We might modify the callback stored if it was interrupted, so we have a ref to identify it
29+
const pending = [];
30+
@@ -16,6 +31,9 @@ export default function createMemoryHistory() {
31+
});
32+
};
33+
const history = {
34+
+ get items() {
35+
+ return items;
36+
+ },
37+
get index() {
38+
var _window$history$state;
39+
// We store an id in the state instead of an index
40+
@@ -32,12 +50,13 @@ export default function createMemoryHistory() {
41+
},
42+
backIndex(_ref) {
43+
let {
44+
- path
45+
+ path,
46+
+ state
47+
} = _ref;
48+
// We need to find the index from the element before current to get closest path to go back to
49+
for (let i = index - 1; i >= 0; i--) {
50+
const item = items[i];
51+
- if (item.path === path) {
52+
+ if (item.path === path && findFocusedRouteKey(item.state) === findFocusedRouteKey(state)) {
53+
return i;
54+
}
55+
}
56+
@@ -68,7 +87,9 @@ export default function createMemoryHistory() {
57+
window.history.pushState({
58+
id
59+
}, '', path);
60+
+ // log();
61+
},
62+
+
63+
replace(_ref3) {
64+
var _window$history$state2;
65+
let {
66+
@@ -108,7 +129,9 @@ export default function createMemoryHistory() {
67+
window.history.replaceState({
68+
id
69+
}, '', pathWithHash);
70+
+ // log();
71+
},
72+
+
73+
// `history.go(n)` is asynchronous, there are couple of things to keep in mind:
74+
// - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.
75+
// - each `history.go(n)` call will trigger a separate `popstate` event with correct location.
76+
@@ -175,20 +198,17 @@ export default function createMemoryHistory() {
77+
// But on Firefox, it seems to take much longer, around 50ms from our testing
78+
// We're using a hacky timeout since there doesn't seem to be way to know for sure
79+
const timer = setTimeout(() => {
80+
- const index = pending.findIndex(it => it.ref === done);
81+
- if (index > -1) {
82+
- pending[index].cb();
83+
- pending.splice(index, 1);
84+
+ const foundIndex = pending.findIndex(it => it.ref === done);
85+
+ if (foundIndex > -1) {
86+
+ pending[foundIndex].cb();
87+
+ pending.splice(foundIndex, 1);
88+
}
89+
+ index = this.index;
90+
}, 100);
91+
const onPopState = () => {
92+
- var _window$history$state3;
93+
- const id = (_window$history$state3 = window.history.state) === null || _window$history$state3 === void 0 ? void 0 : _window$history$state3.id;
94+
- const currentIndex = items.findIndex(item => item.id === id);
95+
-
96+
// Fix createMemoryHistory.index variable's value
97+
// as it may go out of sync when navigating in the browser.
98+
- index = Math.max(currentIndex, 0);
99+
+ index = this.index;
100+
const last = pending.pop();
101+
window.removeEventListener('popstate', onPopState);
102+
last === null || last === void 0 ? void 0 : last.cb();
103+
@@ -202,12 +222,17 @@ export default function createMemoryHistory() {
104+
// Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener
105+
listen(listener) {
106+
const onPopState = () => {
107+
+ // Fix createMemoryHistory.index variable's value
108+
+ // as it may go out of sync when navigating in the browser.
109+
+ index = this.index;
110+
if (pending.length) {
111+
// This was triggered by `history.go(n)`, we shouldn't call the listener
112+
return;
113+
}
114+
listener();
115+
+ // log();
116+
};
117+
+
118+
window.addEventListener('popstate', onPopState);
119+
return () => window.removeEventListener('popstate', onPopState);
120+
}
121+
diff --git a/node_modules/@react-navigation/native/lib/module/findFocusedRouteKey.js b/node_modules/@react-navigation/native/lib/module/findFocusedRouteKey.js
122+
new file mode 100644
123+
index 0000000..16da117
124+
--- /dev/null
125+
+++ b/node_modules/@react-navigation/native/lib/module/findFocusedRouteKey.js
126+
@@ -0,0 +1,7 @@
127+
+import { findFocusedRoute } from '@react-navigation/core';
128+
+export const findFocusedRouteKey = state => {
129+
+ var _findFocusedRoute;
130+
+ // @ts-ignore
131+
+ return (_findFocusedRoute = findFocusedRoute(state)) === null || _findFocusedRoute === void 0 ? void 0 : _findFocusedRoute.key;
132+
+};
133+
+//# sourceMappingURL=findFocusedRouteKey.js.map
134+
\ No newline at end of file
135+
diff --git a/node_modules/@react-navigation/native/lib/module/useLinking.js b/node_modules/@react-navigation/native/lib/module/useLinking.js
136+
index 5bf2a88..a6d0670 100644
137+
--- a/node_modules/@react-navigation/native/lib/module/useLinking.js
138+
+++ b/node_modules/@react-navigation/native/lib/module/useLinking.js
139+
@@ -2,6 +2,7 @@ import { findFocusedRoute, getActionFromState as getActionFromStateDefault, getP
140+
import isEqual from 'fast-deep-equal';
141+
import * as React from 'react';
142+
import createMemoryHistory from './createMemoryHistory';
143+
+import { findFocusedRouteKey } from './findFocusedRouteKey';
144+
import ServerContext from './ServerContext';
145+
/**
146+
* Find the matching navigation state that changed between 2 navigation states
147+
@@ -60,6 +61,44 @@ const series = cb => {
148+
return callback;
149+
};
150+
let linkingHandlers = [];
151+
+const getAllStateKeys = state => {
152+
+ let current = state;
153+
+ const keys = [];
154+
+ if (current.routes) {
155+
+ for (let route of current.routes) {
156+
+ keys.push(route.key);
157+
+ if (route.state) {
158+
+ // @ts-ignore
159+
+ keys.push(...getAllStateKeys(route.state));
160+
+ }
161+
+ }
162+
+ }
163+
+ return keys;
164+
+};
165+
+const getStaleHistoryDiff = (items, newState) => {
166+
+ const newStateKeys = getAllStateKeys(newState);
167+
+ for (let i = items.length - 1; i >= 0; i--) {
168+
+ const itemFocusedKey = findFocusedRouteKey(items[i].state);
169+
+ if (newStateKeys.includes(itemFocusedKey)) {
170+
+ return items.length - i - 1;
171+
+ }
172+
+ }
173+
+ return -1;
174+
+};
175+
+const getHistoryDeltaByKeys = (focusedState, previousFocusedState) => {
176+
+ const focusedStateKeys = focusedState.routes.map(r => r.key);
177+
+ const previousFocusedStateKeys = previousFocusedState.routes.map(r => r.key);
178+
+ const minLength = Math.min(focusedStateKeys.length, previousFocusedStateKeys.length);
179+
+ let matchingKeys = 0;
180+
+ for (let i = 0; i < minLength; i++) {
181+
+ if (focusedStateKeys[i] === previousFocusedStateKeys[i]) {
182+
+ matchingKeys++;
183+
+ } else {
184+
+ break;
185+
+ }
186+
+ }
187+
+ return -(previousFocusedStateKeys.length - matchingKeys);
188+
+};
189+
export default function useLinking(ref, _ref) {
190+
let {
191+
independent,
192+
@@ -251,6 +290,9 @@ export default function useLinking(ref, _ref) {
193+
// Otherwise it's likely a change triggered by `popstate`
194+
path !== pendingPath) {
195+
const historyDelta = (focusedState.history ? focusedState.history.length : focusedState.routes.length) - (previousFocusedState.history ? previousFocusedState.history.length : previousFocusedState.routes.length);
196+
+
197+
+ // The historyDelta and historyDeltaByKeys may differ if the new state has an entry that didn't exist in previous state
198+
+ const historyDeltaByKeys = getHistoryDeltaByKeys(focusedState, previousFocusedState);
199+
if (historyDelta > 0) {
200+
// If history length is increased, we should pushState
201+
// Note that path might not actually change here, for example, drawer open should pushState
202+
@@ -262,34 +304,55 @@ export default function useLinking(ref, _ref) {
203+
// If history length is decreased, i.e. entries were removed, we want to go back
204+
205+
const nextIndex = history.backIndex({
206+
- path
207+
+ path,
208+
+ state
209+
});
210+
const currentIndex = history.index;
211+
try {
212+
if (nextIndex !== -1 && nextIndex < currentIndex) {
213+
// An existing entry for this path exists and it's less than current index, go back to that
214+
await history.go(nextIndex - currentIndex);
215+
+ history.replace({
216+
+ path,
217+
+ state
218+
+ });
219+
} else {
220+
// We couldn't find an existing entry to go back to, so we'll go back by the delta
221+
// This won't be correct if multiple routes were pushed in one go before
222+
// Usually this shouldn't happen and this is a fallback for that
223+
- await history.go(historyDelta);
224+
+ await history.go(historyDeltaByKeys);
225+
+ if (historyDeltaByKeys + 1 === historyDelta) {
226+
+ history.push({
227+
+ path,
228+
+ state
229+
+ });
230+
+ } else {
231+
+ history.replace({
232+
+ path,
233+
+ state
234+
+ });
235+
+ }
236+
}
237+
-
238+
- // Store the updated state as well as fix the path if incorrect
239+
- history.replace({
240+
- path,
241+
- state
242+
- });
243+
} catch (e) {
244+
// The navigation was interrupted
245+
}
246+
} else {
247+
// If history length is unchanged, we want to replaceState
248+
- history.replace({
249+
- path,
250+
- state
251+
- });
252+
+ // and remove any entries from history which focued route no longer exists in state
253+
+ // That may happen if we replace a whole navigator.
254+
+ const staleHistoryDiff = getStaleHistoryDiff(history.items.slice(0, history.index + 1), state);
255+
+ if (staleHistoryDiff <= 0) {
256+
+ history.replace({
257+
+ path,
258+
+ state
259+
+ });
260+
+ } else {
261+
+ await history.go(-staleHistoryDiff);
262+
+ history.push({
263+
+ path,
264+
+ state
265+
+ });
266+
+ }
267+
}
268+
} else {
269+
// If no common navigation state was found, assume it's a replace

0 commit comments

Comments
 (0)