Skip to content

Commit 944dd8b

Browse files
authored
Merge branch 'master' into fix_ai_e2e_tests_for_betatest
2 parents 84fcd82 + 69e3740 commit 944dd8b

Some content is hidden

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

54 files changed

+7453
-581
lines changed

.gitmodules

Whitespace-only changes.

apps/remix-ide-e2e/src/tests/mcp_file_permissions.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ const tests = {
368368
.catch(function (err: any) { done({ error: err.message }); });
369369
}, [])
370370
.refresh()
371-
.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 1000)
371+
.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 10000)
372+
.pause(2000)
372373
.execute(function () {
373374
const aiPlugin = (window as any).getRemixAIPlugin;
374375
if (aiPlugin && aiPlugin.remixMCPServer) {
@@ -380,7 +381,7 @@ const tests = {
380381
})
381382
.pause(1000)
382383
// Should show permission modal
383-
.waitForElementVisible('*[data-id="mcp_file_write_permission_initialModalDialogContainer-react"]', 2000)
384+
.waitForElementVisible('*[data-id="mcp_file_write_permission_initialModalDialogContainer-react"]', 10000)
384385
.waitForElementContainsText('*[data-id="mcp_file_write_permission_initialModalDialogContainer-react"]', 'File Write Permission Required', 5000)
385386
.assert.textContains('*[data-id="mcp_file_write_permission_initialModalDialogContainer-react"]', 'newfile.txt')
386387
},

apps/remix-ide-e2e/src/tests/terminal.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ module.exports = {
292292
.openFile('README.txt')
293293
.addFile('scripts/log_tx_block.js', { content: scriptBlockAndTransaction })
294294
.pause(1000)
295+
.click('*[data-id="toggleBottomPanelIcon"]')
296+
.waitForElementVisible('.terminal-wrap', 5000)
295297
.executeScriptInTerminal('remix.execute(\'scripts/log_tx_block.js\')')
296298
// check if the input of the transaction is being logged (web3 call)
297299
.waitForElementContainsText('*[data-id="terminalJournal"]', '0x2b0006fa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e9e0000000000000000000000000000000000000000000000000000000000004ea373ded44d6900b8b479935bee9c82176261653e334586e0fd282f569357c0777bd9d084474837ac94bf96f2e26590222a2b8e46545657c7cf06ce2833d267bd6f131b5b3fd36cb1ca3e07cf422224df0766d1a677bbdb7ee4cc0d634efa5367a302a94dac422a16b9b8d5c10fe0555924f8189f6b498bef507b1d32e7915bd4df184f51e6d79ae6a1b11d5745ce7d625cecc3bd0dc50af4f999ffb927225f5e5c019b499f5e1fdcbc70c45df61df76013d1b0d45cdf6a267dac1b4620c0db2efd251f6548509c9c69f5bd9d1ee38ac0df0c73be2774f7d2e1fb7ef5129010f29d091e3c48aed0f035fc29804c99927d33ff2a19ff526979355ac50b2542bc5d8f2d41e4f850d5981e0420807469e828b03173b96b757fbaeacda335e11b3ab8b02a48456fab35d41ca26abde751d5fca8ef5e7ba5295278b6e46ce2aab6c10b3d185a6137d3e5c28bb8dd3a797feaf35520fcb949ea074e1869e0011ef01f8162135e44bb797d3d6215ff74ffbee972c97264fc15d11c840e6a7e796dc1a418572f6dbcc842594a558e1a9e3cb7a159284e16fec758bbc303d13edc28fb6d8bb110c3a398e4ded1748da9854eb84679ad0c99bc59bea7956b521db3ed0a9057510cc11365858704989690f0d891af81b213b1f2e91e41e4998a467656eac87e7025ac2840c17f2b106df7d32a0139036bdf5d87344ca37e9ce770e0dbeb5e021d03a7d496a6695eb06d3de9258b43f3883ce155767962b52083504b19d6d609090a2f96e9724902bf1adbf57359ac1dda48a8ffe596b8d95cac1429378769a6ec2ff1c8a9c0bc343b0a6468f36696bfb202cde9f6cd5241b814096d777751b44f0cc2ac9e7ba142227e8d5f2dd8da62573953540da1abce82c59287b2f7a87a111851758c2505d8c1ded6c42a49fc5577451ee56126d2275da490baa645c3bcac0c31dabee7aa35e6cdffb56ac0d952c2583c6f50f906dfb96f5a98c49a5919031cff880bffbe371a50162a7bd0fa0398a5898eaf6ad6db868a7d807846a3592325bb4207d67ad96bac76435368962ba8944d0201c2f620fb29373a6f35c815d101af98111e9b4cc61e8ae77fc63ce375068328ec8d05b49486666fb0f756f99d2fe747c95b2a553965f304a324879393897315d310841f0a200cd156f6ca4ed2', 120000)
@@ -371,6 +373,8 @@ module.exports = {
371373
selector: '*[data-id="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]',
372374
timeout: 240000
373375
})
376+
.click('*[data-id="toggleBottomPanelIcon"]')
377+
.waitForElementVisible('.terminal-wrap', 5000)
374378
.executeScriptInTerminal(`web3.eth.getCode('0x180587b00c8642e2c7ac3a758712d97e6f7bdcc7')`) // mainnet contract
375379
.waitForElementContainsText('*[data-id="terminalJournal"]', '0x608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220969dbb4b1d8aec2bb348e26488dc1a33b6bcf0190f567d161312ab7ca9193d8d64736f6c63430008110033', 120000)
376380
.click('*[data-id="terminalClearConsole"]')

apps/remix-ide/src/app.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ import { TransactionSimulator } from './app/plugins/transaction-simulator'
5555
import { CodeFormat } from './app/plugins/code-format'
5656
import { CompilationDetailsPlugin } from './app/plugins/compile-details'
5757
import { AuthPlugin } from './app/plugins/auth-plugin'
58+
import { S3StoragePlugin } from './app/plugins/storage/s3-storage-plugin'
59+
import { CloudWorkspacesPlugin } from './app/plugins/cloud-workspaces-plugin'
5860
import { InvitationManagerPlugin } from './app/plugins/invitation-manager-plugin'
5961
import { AccountPlugin } from './app/plugins/account-plugin'
6062
import { RemixGuidePlugin } from './app/plugins/remixGuide'
@@ -175,6 +177,8 @@ class AppComponent {
175177
templateExplorerModal: TemplateExplorerModalPlugin
176178
settings: SettingsTab
177179
authPlugin: AuthPlugin
180+
s3StoragePlugin: S3StoragePlugin
181+
cloudWorkspacesPlugin: CloudWorkspacesPlugin
178182
invitationManager: InvitationManagerPlugin
179183
accountPlugin: AccountPlugin
180184
params: any
@@ -615,6 +619,8 @@ class AppComponent {
615619
)
616620

617621
this.authPlugin = new AuthPlugin()
622+
this.s3StoragePlugin = new S3StoragePlugin()
623+
this.cloudWorkspacesPlugin = new CloudWorkspacesPlugin()
618624
this.invitationManager = new InvitationManagerPlugin()
619625
const feedbackPlugin = new FeedbackPlugin()
620626

@@ -631,6 +637,8 @@ class AppComponent {
631637
openZeppelinProxy,
632638
run.recorder,
633639
this.authPlugin,
640+
this.s3StoragePlugin,
641+
this.cloudWorkspacesPlugin,
634642
this.invitationManager,
635643
this.accountPlugin,
636644
feedbackPlugin
@@ -705,6 +713,16 @@ class AppComponent {
705713
])
706714

707715
await this.appManager.activatePlugin(['auth'])
716+
// Activate/deactivate cloud plugins based on auth state
717+
this.appManager.on('auth', 'authStateChanged', async (state: any) => {
718+
if (state.isAuthenticated) {
719+
await this.appManager.activatePlugin(['s3Storage'])
720+
await this.appManager.activatePlugin(['cloudWorkspaces'])
721+
} else {
722+
await this.appManager.deactivatePlugin('cloudWorkspaces')
723+
await this.appManager.deactivatePlugin('s3Storage')
724+
}
725+
})
708726
await this.appManager.activatePlugin(['invitationManager'])
709727
await this.appManager.activatePlugin(['account'])
710728
await this.appManager.activatePlugin(['notificationCenter'])

apps/remix-ide/src/app/files/fileProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ export default class FileProvider {
9494
async get (path, cb, options = { encoding: 'utf8' }) {
9595
cb = cb || function () { /* do nothing. */ }
9696
path = this.getPathFromUrl(path) || path // ensure we actually use the normalized path from here
97+
console.log('Getting content of ' + path)
9798
const unprefixedpath = this.removePrefix(path)
99+
console.log('Unprefixed path: ' + unprefixedpath)
98100
try {
99101
const content = await (window as any).remixFileSystem.readFile(unprefixedpath, options)
100102
if (cb) cb(null, content)

apps/remix-ide/src/app/panels/file-panel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ export default class Filepanel extends ViewPlugin {
168168
name: ws.name,
169169
isGitRepo: ws.isGitRepo || false,
170170
hasGitSubmodules: ws.hasGitSubmodules || false,
171-
isGist: typeof ws.isGist === 'string' ? ws.isGist : null
171+
isGist: typeof ws.isGist === 'string' ? ws.isGist : null,
172+
remoteId: ws.remoteId || null
172173
}))
173174
}
174175

apps/remix-ide/src/app/plugins/auth-plugin.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ export class AuthPlugin extends Plugin {
584584
// Update other API services too
585585
this.creditsApi.setToken(token)
586586
this.permissionsApi.setToken(token)
587+
this.billingApi.setToken(token)
587588
this.inviteApi.setToken(token)
588589
}
589590

@@ -621,20 +622,19 @@ export class AuthPlugin extends Plugin {
621622
this.apiClient.setToken(newAccessToken)
622623
this.creditsApi.setToken(newAccessToken)
623624
this.permissionsApi.setToken(newAccessToken)
625+
this.billingApi.setToken(newAccessToken)
624626
this.inviteApi.setToken(newAccessToken)
625627

626628
console.log('[AuthPlugin] Access token refreshed successfully')
627629
// Reschedule next proactive refresh
628630
this.scheduleRefresh(newAccessToken)
629631

630-
// Notify other plugins about the refreshed token
631-
const userStr = localStorage.getItem('remix_user')
632-
const user = userStr ? JSON.parse(userStr) : null
633-
this.emit('authStateChanged', {
634-
isAuthenticated: true,
635-
user,
636-
token: newAccessToken
637-
})
632+
// Notify all listeners about the new token
633+
// Only emit tokenRefreshed — NOT authStateChanged.
634+
// The user hasn't changed, only the token was refreshed.
635+
// Emitting authStateChanged here would cause all consumers to re-initialize
636+
// (reload configs, re-read S3 data, etc.) for no reason.
637+
this.emit('tokenRefreshed', { token: newAccessToken })
638638

639639
return newAccessToken
640640
}

0 commit comments

Comments
 (0)