Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/eighty-coins-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@powersync/service-core': patch
---

Improved Postgres connection port restrictions. Connections are now supported on ports >= 1024.
2 changes: 1 addition & 1 deletion packages/service-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build": "tsc -b",
"build:tests": "tsc -b test/tsconfig.json",
"test": "vitest --no-threads",
"clean": "rm -rf ./lib && tsc -b --clean"
"clean": "rm -rf ./dist && tsc -b --clean"
},
"dependencies": {
"@js-sdsl/ordered-set": "^4.4.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/types/src/config/normalize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PostgresConnection } from './PowerSyncConfig.js';
import * as urijs from 'uri-js';
import { PostgresConnection } from './PowerSyncConfig.js';

/**
* Validate and normalize connection options.
Expand Down Expand Up @@ -97,11 +97,10 @@ export function validatePort(port: string | number): number {
if (typeof port == 'string') {
port = parseInt(port);
}
if (port >= 1024 && port <= 49151) {
return port;
} else {
if (port < 1024) {
throw new Error(`Port ${port} not supported`);
}
return port;
}

/**
Expand Down
Loading