Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
894
Issues
894
List
Boards
Labels
Service Desk
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
981625c3
Commit
981625c3
authored
11 minutes ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): Diagnostics ID flood
parent
100602ee
hotfix/sentry-injection
1 merge request
!534
[Sprint/ModestMonkey] (fix): Diagnostics ID flood
Pipeline
#80284706
running with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
5 deletions
+36
-5
app.component.ts
src/app/app.component.ts
+6
-1
diagnostics.service.ts
src/app/services/diagnostics.service.ts
+28
-0
providers.ts
src/app/services/providers.ts
+2
-0
session.ts
src/app/services/session.ts
+0
-4
No files found.
src/app/app.component.ts
View file @
981625c3
...
...
@@ -17,6 +17,7 @@ import { BlockListService } from './common/services/block-list.service';
import
{
FeaturesService
}
from
'
./services/features.service
'
;
import
{
ThemeService
}
from
'
./common/services/theme.service
'
;
import
{
BannedService
}
from
'
./modules/report/banned/banned.service
'
;
import
{
DiagnosticsService
}
from
'
./services/diagnostics.service
'
;
@
Component
({
moduleId
:
module
.
id
,
...
...
@@ -50,12 +51,16 @@ export class Minds {
public
blockListService
:
BlockListService
,
public
featuresService
:
FeaturesService
,
public
themeService
:
ThemeService
,
private
bannedService
:
BannedService
private
bannedService
:
BannedService
,
private
diagnostics
:
DiagnosticsService
)
{
this
.
name
=
'
Minds
'
;
}
async
ngOnInit
()
{
this
.
diagnostics
.
setUser
(
this
.
minds
.
user
);
this
.
diagnostics
.
listen
();
// Listen for user changes
this
.
notificationService
.
getNotifications
();
this
.
session
.
isLoggedIn
(
async
is
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/services/diagnostics.service.ts
0 → 100644
View file @
981625c3
import
{
Injectable
}
from
'
@angular/core
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
Session
}
from
'
./session
'
;
@
Injectable
()
export
class
DiagnosticsService
{
constructor
(
protected
session
:
Session
)
{}
listen
()
{
this
.
session
.
getLoggedInUser
(
currentUser
=>
{
this
.
setUser
(
currentUser
);
});
}
setUser
(
currentUser
)
{
let
userId
=
null
;
if
(
currentUser
)
{
userId
=
currentUser
.
guid
||
null
;
}
Sentry
.
setUser
({
id
:
userId
,
});
console
.
info
(
'
Diagnostics ID:
'
,
userId
);
}
}
This diff is collapsed.
Click to expand it.
src/app/services/providers.ts
View file @
981625c3
...
...
@@ -42,6 +42,7 @@ import { InMemoryStorageService } from './in-memory-storage.service';
import
{
FeedsService
}
from
'
../common/services/feeds.service
'
;
import
{
ThemeService
}
from
'
../common/services/theme.service
'
;
import
{
GlobalScrollService
}
from
'
./ux/global-scroll.service
'
;
import
{
DiagnosticsService
}
from
'
./diagnostics.service
'
;
export
const
MINDS_PROVIDERS
:
any
[]
=
[
{
...
...
@@ -222,4 +223,5 @@ export const MINDS_PROVIDERS: any[] = [
useFactory
:
ThemeService
.
_
,
deps
:
[
RendererFactory2
,
Client
,
Session
,
Storage
],
},
DiagnosticsService
,
];
This diff is collapsed.
Click to expand it.
src/app/services/session.ts
View file @
981625c3
...
...
@@ -2,7 +2,6 @@
* Sessions
*/
import
{
EventEmitter
}
from
'
@angular/core
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
export
class
Session
{
loggedinEmitter
:
EventEmitter
<
any
>
=
new
EventEmitter
();
...
...
@@ -51,9 +50,6 @@ export class Session {
if
(
window
.
Minds
.
user
)
{
// Attach user_guid to debug logs
Sentry
.
setUser
({
id
:
window
.
Minds
.
user
.
guid
,
});
return
window
.
Minds
.
user
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment