Skip to content

Commit 91e12f6

Browse files
authored
fix: don't load bench.js files (#2207)
* fix: autoloader grabbing bench.js files * fix: errors failing * fix: extension cache typ * cache: app icons
1 parent f8bdcf8 commit 91e12f6

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

extensions/api.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { RequestHandler } from 'express';
1414
import type FSNodeContext from '../src/backend/src/filesystem/FSNodeContext.js';
1515
import type helpers from '../src/backend/src/helpers.js';
1616
import type * as ExtensionControllerExports from './ExtensionController/src/ExtensionController.ts';
17+
import kvjs from '@heyputer/kv.js';
1718
declare global {
1819
namespace Express {
1920
interface Request {
@@ -96,7 +97,7 @@ interface Extension extends RouterMethods {
9697
on(event: 'create.drivers', listener: (event: { createDriver: (interface: string, service: string, executors: any) => any }) => void),
9798
on(event: 'create.permissions', listener: (event: { grant_to_everyone: (permission: string) => void, grant_to_users: (permission: string) => void }) => void)
9899
on(event: 'create.interfaces', listener: (event: { createInterface: (interface: string, interfaces: DriverInterface) => void }) => void)
99-
import(module: 'data'): { db: BaseDatabaseAccessService, kv: DynamoKVStore, cache: unknown } // TODO DS: type cache better
100+
import(module: 'data'): { db: BaseDatabaseAccessService, kv: DynamoKVStore, cache: kvjs }
100101
import(module: 'core'): CoreRuntimeModule,
101102
import(module: 'fs'): FilesystemModule,
102103
import(module: 'query'): typeof query,

package-lock.json

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

src/backend/src/Kernel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,13 @@ class Kernel extends AdvancedBase {
516516
const fullpath = path_.join(mod_path, directory);
517517
const fsitems = fs.readdirSync(fullpath);
518518
for ( const item of fsitems ) {
519-
if ( ! item.endsWith('.js') ) {
519+
if ( !item.endsWith('.js') && !item.endsWith('.cjs') && !item.endsWith('.mjs') ) {
520520
continue;
521521
}
522-
if ( item.endsWith('.test.js') ) {
522+
if ( item.endsWith('.test.js') || item.endsWith('.bench.js') ) {
523523
continue;
524524
}
525+
525526
const stat = fs.statSync(path_.join(fullpath, item));
526527
if ( ! stat.isFile() ) {
527528
continue;

src/backend/src/modules/apps/AppIconService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class AppIconService extends BaseService {
7979
} = await this.get_icon_stream({ app_uid, size });
8080

8181
res.set('Content-Type', mime);
82+
res.set('Cache-Control', 'public, max-age=3600');
8283
stream.pipe(res);
8384
},
8485
}).attach(app);

tests/ci/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_admin_password() -> str:
3030
"""
3131
Get the admin password from the backend server, throw an error if not found.
3232
"""
33-
for attempt in range(90): # wait up to 60 seconds (1 minute)
33+
for attempt in range(120): # wait up to 60 seconds (1 minute)
3434
time.sleep(1)
3535

3636
# read the log file
@@ -43,7 +43,7 @@ def get_admin_password() -> str:
4343
print(f"Extracted admin password: {admin_password}")
4444
return admin_password
4545

46-
raise RuntimeError(f"no admin password found after 60 seconds, check {LOG_PATH} for details")
46+
raise RuntimeError(f"no admin password found after 120 seconds")
4747

4848

4949
def get_token(admin_password: str) -> str:

0 commit comments

Comments
 (0)