Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
8c22036d
Verified
Commit
8c22036d
authored
Jun 6, 2024
by
henry
Committed by
Pier Angelo Vendrame
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Bug 40597: Implement TorSettings module
Bug 42622: Send TorConnect "Error" signal before "StateChange".
parent
edacb44b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1223
Bug 43167: Rebased stable onto 115.16.0esr
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/modules/TorConnect.sys.mjs
+18
-10
18 additions, 10 deletions
toolkit/modules/TorConnect.sys.mjs
with
18 additions
and
10 deletions
toolkit/modules/TorConnect.sys.mjs
+
18
−
10
View file @
8c22036d
...
...
@@ -685,16 +685,7 @@ class ErrorState extends StateCallback {
ErrorState
.
#hasEverHappened
=
true
;
}
run
(
error
)
{
if
(
!
(
error
instanceof
TorConnectError
))
{
error
=
new
TorConnectError
(
TorConnectError
.
ExternalError
,
error
);
}
TorConnect
.
_errorCode
=
error
.
code
;
TorConnect
.
_errorDetails
=
error
;
lazy
.
logger
.
error
(
`Entering error state (
${
error
.
code
}
)`
,
error
);
Services
.
obs
.
notifyObservers
(
error
,
TorConnectTopics
.
Error
);
run
(
_error
)
{
this
.
changeState
(
TorConnectState
.
Configuring
);
}
...
...
@@ -902,6 +893,23 @@ export const TorConnect = {
// Set our new state first so that state transitions can themselves
// trigger a state transition.
this
.
_stateHandler
=
this
.
_makeState
(
newState
);
// Error signal needs to be sent out before we enter the Error state.
// Expected on android `onBootstrapError` to set lastKnownError.
// Expected in about:torconnect to set the error codes and internet status
// *before* the StateChange signal.
if
(
newState
===
TorConnectState
.
Error
)
{
let
error
=
args
[
0
];
if
(
!
(
error
instanceof
TorConnectError
))
{
error
=
new
TorConnectError
(
TorConnectError
.
ExternalError
,
error
);
}
TorConnect
.
_errorCode
=
error
.
code
;
TorConnect
.
_errorDetails
=
error
;
lazy
.
logger
.
error
(
`Entering error state (
${
error
.
code
}
)`
,
error
);
Services
.
obs
.
notifyObservers
(
error
,
TorConnectTopics
.
Error
);
}
Services
.
obs
.
notifyObservers
(
{
state
:
newState
},
TorConnectTopics
.
StateChange
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment