Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnect #484

Merged
merged 47 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
12cc710
Adding support for ice_servers message
daonb Jun 24, 2024
ea5264c
Fixing handling of ice_servers message
daonb Jul 1, 2024
bca985c
Fixing zoom
daonb Jul 23, 2024
5ca9727
Polishing
daonb Jul 31, 2024
82b80df
Fixing direct pane navigation on the web
daonb Jul 31, 2024
fab7fcb
Polishing
daonb Aug 1, 2024
a5f6a6c
Adding a lost s
daonb Aug 1, 2024
cdbc68c
Polishing some more
daonb Aug 1, 2024
11282fd
Improving messages
daonb Jun 27, 2024
1548f90
Fixing webgl out of memory, fix #341
daonb Aug 1, 2024
41f9f53
Polishing
daonb Aug 1, 2024
7857292
Fixing late arriving answers handling
daonb Aug 1, 2024
6d3e29e
Fixing peerbook reconnection failures
daonb Aug 1, 2024
694939c
Fixing fit my screen for a single user
daonb Aug 5, 2024
f68522b
Improving pb error handling
daonb Aug 7, 2024
8022d7e
Fixing a bug with ICE configuration
daonb Aug 7, 2024
5678746
Setting window focus right
daonb Aug 8, 2024
c9c0e3d
Polishing
daonb Aug 8, 2024
b4f0e63
Improving reconnect & not for the last time
daonb Aug 11, 2024
4a3eded
Fixing the gates' parent
daonb Aug 11, 2024
f02a376
Extending a timeout in a test
daonb Aug 11, 2024
ff0f273
Merge branch 'master' into reconnect
daonb Aug 12, 2024
12f0ffb
Hiding TWR on pane tab & doubletap
daonb Aug 13, 2024
405155b
Making the gates-container to a class
daonb Aug 13, 2024
8368628
WIP
daonb Aug 13, 2024
7bd394f
Fixing reconnect
daonb Aug 18, 2024
02cd0f1
Polishing
daonb Aug 19, 2024
15c403d
Killing the canary as it was more noise than signal
daonb Aug 21, 2024
2cdcfad
Improving gate and shell recovery
daonb Aug 21, 2024
edeb707
Improving peerbook admin messages id & cleanuo
daonb Aug 21, 2024
4a78fea
Adding timw to log messages
daonb Aug 21, 2024
ad69190
Simplifying pbConnect
daonb Aug 21, 2024
f1348ed
Adding isOpenish and file cleanup
daonb Aug 21, 2024
4dd25b3
Removing redundent watchdog
daonb Aug 22, 2024
9717846
Fixing first install
daonb Aug 22, 2024
adb1ae6
Polishing
daonb Aug 22, 2024
6ac5d77
Fixing two small bugs
daonb Aug 27, 2024
523f4a9
Opening the CDC when needed
daonb Aug 27, 2024
dd9dc26
Clearing penging message to prevent doubling
daonb Aug 27, 2024
df1d515
Ignoring signaling state when getting candidate
daonb Aug 27, 2024
09221b2
Removing a log message
daonb Aug 27, 2024
7034b3c
Removing another log line
daonb Aug 27, 2024
4a972fd
Extending a timeout
daonb Aug 27, 2024
c437173
Improving unit tests stability
daonb Aug 27, 2024
4a34f8e
Linting
daonb Aug 27, 2024
0aa3fbf
Polishing
daonb Aug 27, 2024
1dba143
Cleaning up
daonb Aug 28, 2024
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ you can now set `font_family` and `font_size`.

### Fixed

- CMD-[1-9] on the web now switches to the corresponding tab
- Handling of unverified hosts
- Multi client layout sync
- The font in rename and search is set to Fira Sans like the rest of the app
- Fixing the font used in rename and search
- Handling of out-of-band peerbook answers

## [1.10.1] - 2024/5/7

Expand Down
4 changes: 1 addition & 3 deletions aatp/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export async function connectFirstGate(page, gateName?) {
await btn.click()
}
export async function getTWRBuffer(page) {
console.log("getting twr buffer")
let ret = await page.evaluate(() => {
const t = window.terminal7.map.t0
const b = t.buffer.active
Expand All @@ -36,10 +35,9 @@ export async function getTWRBuffer(page) {
}
return ret.trimEnd()
})
console.log("--> b4 trimming:", ret)
ret = ret.substring(checkedC)
console.log("TWR: ", ret)
checkedC = ret.length
console.log("TWR", ret)
return ret
}
export function webexecReset(uid: string) {
Expand Down
13 changes: 12 additions & 1 deletion aatp/http_webrtc/http_webrtc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ pinch_max_y_velocity = 0.1`
await expect(page.locator('.windows-container')).toBeVisible()
await expect(page.locator('.pane')).toHaveCount(1)
})
test('handling background events', async() => {
await page.evaluate(async() =>
window.terminal7.onAppStateChange({isActive: false}))
await sleep(500)
await page.screenshot({ path: `/result/7.png` })
await page.evaluate(async() =>
window.terminal7.onAppStateChange({isActive: true}))
await expect(page.locator('.windows-container')).toBeVisible()
await expect(page.locator('.pane')).toHaveCount(1)
await expect(page.locator('#twr')).toBeHidden()

})
test.skip('auto restore gate', async() => {
connectFirstGate(page)
await expect(page.locator('.pane')).toHaveCount(1)
Expand All @@ -177,7 +189,6 @@ pinch_max_y_velocity = 0.1`
})
await reloadPage()
await sleep(1000)
await page.screenshot({ path: `/result/7.png` })
await expect(page.locator('.pane')).toHaveCount(1)
const inGate = await page.evaluate(() => window.terminal7.activeG != null)
expect(inGate).toBeTruthy()
Expand Down
2 changes: 1 addition & 1 deletion aatp/infra/peerbook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ RUN go get ./...
ENV REDIS_HOST=redis:6379
ENV PB_STATIC_ROOT=/home/peerbook/src/peerbook/html
EXPOSE 17777
CMD go run .
CMD go run . -addr 0.0.0.0:17777
9 changes: 6 additions & 3 deletions aatp/ui/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ insecure=true`)
return terminal7.gates[0].sshPort
})
expect(port).toEqual(1234)
// hide TWR for next test
await page.keyboard.type("hide")
await page.keyboard.press("Enter")
})

test('a host with no port can added', async () => {
Expand All @@ -105,7 +108,7 @@ insecure=true`)
await page.reload({ waitUntil: "networkidle" })
const addBtn = page.locator('[data-test="addButton"]').first()
await addBtn.click()
await sleep(100)
await waitForTWROutput(page, "Enter destination", 500)
await page.keyboard.type("baz:1234")
await page.keyboard.press("Enter")
const port = await page.evaluate(async () => {
Expand Down Expand Up @@ -148,7 +151,7 @@ insecure=true`)
await page.keyboard.type("hide")
await page.keyboard.press("Enter")
})
test('connect to gate with no webexec', async () => {
test('connect to gate with no webexec, get install command', async () => {
await runSSHCommand(webexecSSHConfig, "webexec stop")
await connectFirstGate(page)
await sleep(1000)
Expand Down Expand Up @@ -229,7 +232,7 @@ insecure=true`)
await expect(page.locator('#t0')).toBeHidden()
await expect(page.locator('.pane')).toHaveCount(1)
await expect(page.locator('.windows-container')).toBeVisible()
await waitForTWROutput(page, /foo:.* over WebRTC/, 1000)
await waitForTWROutput(page, /foo:.* over WebRTC/, 2000)
})
test('how a gate handles disconnect', async() => {
await page.evaluate(async () =>
Expand Down
6 changes: 3 additions & 3 deletions css/terminal7.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ body {
}
* {
box-sizing: border-box;
touch-action: none;
}
*:focus { outline: none; }

Expand Down Expand Up @@ -164,7 +163,7 @@ a {
.keys-help tr:last-child {
border-bottom: none;
}
#gates-container {
.gates-container {
position: fixed;
top: 0;
left: 0;
Expand All @@ -182,7 +181,7 @@ a {
left: 0;
z-index: 2;
}
.native #gates-container {
.native .gates-container {
top: 22px;
}
.window {
Expand Down Expand Up @@ -325,6 +324,7 @@ nav::-webkit-scrollbar {
width: 100%;
position: absolute;
z-index: 3;
touch-action: none;
}
.oneline-box {
color: var(--text-color);
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-title" content="Terminal7" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<script src="/virtual-webgl2.js"></script>
<script type="module" src="/main.ts" defer></script>

</head>
Expand Down Expand Up @@ -73,7 +74,7 @@ <h1 id="title-short">T7</h1>
<footer>map inspired by Eero Saarinen's T5</footer>
</div>
</div>
<div id="gates-container">
<div class="gates-container">
<div id="active-gate-stats" class="gate-stats"></div>
<div class="hidden zoomed pane-container" id="zoomed-pane"> </div>
</div>
Expand Down
5 changes: 0 additions & 5 deletions ios/App/App/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"preferences": {}
},
"packageClassList": [
"NativeAudio",
"NativeAudio",
"AppPlugin",
"CAPBrowserPlugin",
Expand All @@ -32,12 +31,8 @@
"PreferencesPlugin",
"StatusBarPlugin",
"PurchasesPlugin",
"PurchasesPlugin",
"NativeBiometric",
"NativeBiometric",
"CapacitorRateAppPlugin",
"CapacitorRateAppPlugin",
"SSHPlugin",
"SSHPlugin"
]
}
44 changes: 22 additions & 22 deletions ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
PODS:
- Capacitor (6.0.0):
- Capacitor (6.1.1):
- CapacitorCordova
- CapacitorApp (6.0.0):
- Capacitor
- CapacitorBrowser (6.0.0):
- CapacitorBrowser (6.0.1):
- Capacitor
- CapacitorCamera (6.0.0):
- CapacitorCamera (6.0.1):
- Capacitor
- CapacitorClipboard (6.0.0):
- Capacitor
- CapacitorCommunityNativeAudio (5.0.1):
- Capacitor
- CapacitorCordova (6.0.0)
- CapacitorCordova (6.1.1)
- CapacitorDevice (6.0.0):
- Capacitor
- CapacitorFilesystem (6.0.0):
- Capacitor
- CapacitorKeyboard (6.0.0):
- CapacitorKeyboard (6.0.1):
- Capacitor
- CapacitorNativeBiometric (0.0.1):
- Capacitor
- CapacitorNetwork (6.0.0):
- CapacitorNetwork (6.0.1):
- Capacitor
- CapacitorPreferences (6.0.0):
- CapacitorPreferences (6.0.1):
- Capacitor
- CapacitorRateApp (4.0.3):
- Capacitor
Expand All @@ -32,12 +32,12 @@ PODS:
- CapacitorStatusBar (6.0.0):
- Capacitor
- NMSSHT7 (2.9.1)
- PurchasesHybridCommon (10.6.1):
- RevenueCat (= 4.41.2)
- RevenueCat (4.41.2)
- RevenuecatPurchasesCapacitor (7.5.9):
- PurchasesHybridCommon (11.1.1):
- RevenueCat (= 4.43.2)
- RevenueCat (4.43.2)
- RevenuecatPurchasesCapacitor (7.7.1):
- Capacitor
- PurchasesHybridCommon (= 10.6.1)
- PurchasesHybridCommon (= 11.1.1)

DEPENDENCIES:
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
Expand Down Expand Up @@ -101,26 +101,26 @@ EXTERNAL SOURCES:
:path: "../../node_modules/@revenuecat/purchases-capacitor"

SPEC CHECKSUMS:
Capacitor: 559d073c4ca6c27f8e7002c807eea94c3ba435a9
Capacitor: 8941aba4364ba9d1b22188569001f2ce45cc2b00
CapacitorApp: 9d53aec7101f7b030a950c5bdc4df8612576b279
CapacitorBrowser: 7e1e2cdbb3e372f09f0bad0c4c21a6d187b679ad
CapacitorCamera: b61f125d92a0ef75d7becb7956fed7dd13187ee0
CapacitorBrowser: 473c7fd70ddbe541608ff09ec1be14da0078279e
CapacitorCamera: 3b77b3e8311b98220de65e63445c0e4d0b30ce3a
CapacitorClipboard: 80282f684154124b9019ebf401235b70b0cf4994
CapacitorCommunityNativeAudio: 1a4d5490acb59f155602c0b6bcf1b42ee4efe91b
CapacitorCordova: 8c4bfdf69368512e85b1d8b724dd7546abeb30af
CapacitorCordova: 8f2cc8d8d3619c566e9418fe8772064a94266106
CapacitorDevice: f8fd88f9edd1261c55a109f32015b09bbbfdc4a0
CapacitorFilesystem: 60e59ba274c234a979e7a3be2552feaadcee4263
CapacitorKeyboard: deacbd09d8d1029c3681197fb05d206b721d5f73
CapacitorKeyboard: 5f32a712adf41e07a61caafb82cf29fb6d8ba123
CapacitorNativeBiometric: b47637a8cd349bdac014424bb4ddcae9ee5d4919
CapacitorNetwork: f15a94c16a33cba7c47a17814cb6bcfe3ea34ded
CapacitorPreferences: c9b839a80baa72e4ed4bdb117618e1950d3046b5
CapacitorNetwork: 5c94acfdddc22043f2ffaff224ce9b4aa5a179f0
CapacitorPreferences: 72909b165bc7807103778ddbb86d5d8ce06abf71
CapacitorRateApp: 896df7ec6a237fea72d1955e0cb26394654b00db
CapacitorSshPlugin: 79f67cb26d40bd0c07cec6dda93d93d5faf7b614
CapacitorStatusBar: 2e4369f99166125435641b1908d05f561eaba6f6
NMSSHT7: 67f9d8f43b40b997728761b4cf2aa7ea660ba7c2
PurchasesHybridCommon: 465af21945a10dda051b725933a1fd7b7c2d2a07
RevenueCat: 0250867579677899de94f96ad9be342be865560f
RevenuecatPurchasesCapacitor: 3356d0d375cf40dcde55555cbcff43eb9a99e7c0
PurchasesHybridCommon: 73f4f2c6e4ec3487b4219bf60e1661100fb85da3
RevenueCat: 3d934653b7e8b09af88fd47e9e84cfaf5d0a89ba
RevenuecatPurchasesCapacitor: 180baf04b08c3bd1aac2abe60f536aa35196cbc3

PODFILE CHECKSUM: 0b234f47d92ce42f718c406e1f2c37447bc3c605

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
},
"dependencies": {
"@capacitor-community/native-audio": "^5.0.1",
"@capacitor/android": "^6.0.0",
"@capacitor/android": "^6.1.1",
"@capacitor/app": "^6.0.0",
"@capacitor/browser": "^6.0.0",
"@capacitor/camera": "^6.0.0",
"@capacitor/cli": "^6.0.0",
"@capacitor/browser": "^6.0.1",
"@capacitor/camera": "^6.0.1",
"@capacitor/cli": "^6.1.1",
"@capacitor/clipboard": "^6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/core": "^6.1.1",
"@capacitor/device": "^6.0.0",
"@capacitor/filesystem": "^6.0.0",
"@capacitor/ios": "^6.0.0",
"@capacitor/keyboard": "^6.0.0",
"@capacitor/network": "^6.0.0",
"@capacitor/preferences": "^6.0.0",
"@capacitor/ios": "^6.1.1",
"@capacitor/keyboard": "^6.0.1",
"@capacitor/network": "^6.0.1",
"@capacitor/preferences": "^6.0.1",
"@capacitor/status-bar": "^6.0.0",
"@revenuecat/purchases-capacitor": "^7.0.0",
"@revenuecat/purchases-capacitor": "^7.7.1",
"@tuzig/codemirror": "5.65.5-mods",
"@tuzig/toml": "^3.0.0-browser",
"@types/marked": "^4.0.7",
Expand Down
2 changes: 2 additions & 0 deletions prompts/replace_hammerjs.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
We need to replace hammerjs package as it's not maintained anymore.
What package should we use? We currently use hammerjs for tap, pan, cut , press and pinch events.
1 change: 1 addition & 0 deletions prompts/scaling.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We need to write a js function that will receive a scale factor and a container element that includes on or more WebGL canvases. the function should the container element and a ll the canvases.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix grammatical error and consider adding implementation criteria.

There is a grammatical error in the prompt. The corrected sentence should be: "The function should scale the container element and all the canvases." Additionally, consider adding criteria for the function's implementation, such as performance, compatibility, or specific scaling requirements.

Apply this diff to fix the grammatical error:

-We need to write a js function that will receive a scale factor and a container element that includes on or more WebGL canvases. the function should the container element and a ll the canvases.
+We need to write a js function that will receive a scale factor and a container element that includes one or more WebGL canvases. The function should scale the container element and all the canvases.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
We need to write a js function that will receive a scale factor and a container element that includes on or more WebGL canvases. the function should the container element and a ll the canvases.
We need to write a js function that will receive a scale factor and a container element that includes one or more WebGL canvases. The function should scale the container element and all the canvases.
Tools
LanguageTool

[uncategorized] ~1-~1: There appears to be a verb missing here.
Context: ...on or more WebGL canvases. the function should the container element and a ll the canvases...

(WOULD_A)

Loading
Loading