Skip to content

Commit

Permalink
Fix exception `initial databaseList request failed: T.sort is not a f…
Browse files Browse the repository at this point in the history
…unction`

Summary: Exception showed up in our monitoring. The only `.sort` that happens in that request/response sequence is the one updated. Didn't get to the root of this, but likely the plugin returns nothing rather than an empty array when no databases present?

Reviewed By: LukeDefeo

Differential Revision: D47665268

fbshipit-source-id: 3f8dea591db3e6cb5d4e0d09f893a177ad4f642e
  • Loading branch information
Michel Weststrate authored and facebook-github-bot committed Jul 24, 2023
1 parent 6048f09 commit e7ac579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion desktop/plugins/public/databases/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function plugin(client: PluginClient<Events, Methods>) {
const updateDatabases = (event: {
databases: Array<{name: string; id: number; tables: Array<string>}>;
}) => {
const updates = event.databases;
const updates = event.databases ?? [];
const state = pluginState.get();
const databases = updates.sort((db1, db2) => db1.id - db2.id);
const selectedDatabase =
Expand Down

0 comments on commit e7ac579

Please sign in to comment.