Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
5b6db8a6
Unverified
Commit
5b6db8a6
authored
6 years ago
by
Eugen Rochko
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Disable service worker media cache and IndexedDB storage (#7932)
Fix #7893 Fix #7615
parent
4045b50b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/javascript/mastodon/actions/importer/index.js
+4
-4
4 additions, 4 deletions
app/javascript/mastodon/actions/importer/index.js
app/javascript/mastodon/service_worker/entry.js
+8
-8
8 additions, 8 deletions
app/javascript/mastodon/service_worker/entry.js
with
12 additions
and
12 deletions
app/javascript/mastodon/actions/importer/index.js
+
4
−
4
View file @
5b6db8a6
import
{
autoPlayGif
}
from
'
../../initial_state
'
;
import
{
putAccounts
,
putStatuses
}
from
'
../../storage/modifier
'
;
//
import { autoPlayGif } from '../../initial_state';
//
import { putAccounts, putStatuses } from '../../storage/modifier';
import
{
normalizeAccount
,
normalizeStatus
}
from
'
./normalizer
'
;
export
const
ACCOUNT_IMPORT
=
'
ACCOUNT_IMPORT
'
;
...
...
@@ -45,7 +45,7 @@ export function importFetchedAccounts(accounts) {
}
accounts
.
forEach
(
processAccount
);
putAccounts
(
normalAccounts
,
!
autoPlayGif
);
//
putAccounts(normalAccounts, !autoPlayGif);
return
importAccounts
(
normalAccounts
);
}
...
...
@@ -69,7 +69,7 @@ export function importFetchedStatuses(statuses) {
}
statuses
.
forEach
(
processStatus
);
putStatuses
(
normalStatuses
);
//
putStatuses(normalStatuses);
dispatch
(
importFetchedAccounts
(
accounts
));
dispatch
(
importStatuses
(
normalStatuses
));
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/service_worker/entry.js
+
8
−
8
View file @
5b6db8a6
import
{
freeStorage
,
storageFreeable
}
from
'
../storage/modifier
'
;
//
import { freeStorage, storageFreeable } from '../storage/modifier';
import
'
./web_push_notifications
'
;
function
openSystemCache
()
{
return
caches
.
open
(
'
mastodon-system
'
);
}
//
function openSystemCache() {
//
return caches.open('mastodon-system');
//
}
function
openWebCache
()
{
return
caches
.
open
(
'
mastodon-web
'
);
...
...
@@ -13,8 +13,8 @@ function fetchRoot() {
return
fetch
(
'
/
'
,
{
credentials
:
'
include
'
,
redirect
:
'
manual
'
});
}
const
firefox
=
navigator
.
userAgent
.
match
(
/Firefox
\/(\d
+
)
/
);
const
invalidOnlyIfCached
=
firefox
&&
firefox
[
1
]
<
60
;
//
const firefox = navigator.userAgent.match(/Firefox\/(\d+)/);
//
const invalidOnlyIfCached = firefox && firefox[1] < 60;
// Cause a new version of a registered Service Worker to replace an existing one
// that is already installed, and replace the currently active worker on open pages.
...
...
@@ -52,7 +52,7 @@ self.addEventListener('fetch', function(event) {
return
response
;
}));
}
else
if
(
storageFreeable
&&
(
ATTACHMENT_HOST
?
url
.
host
===
ATTACHMENT_HOST
:
url
.
pathname
.
startsWith
(
'
/system/
'
)))
{
}
/*
else if (storageFreeable && (ATTACHMENT_HOST ? url.host === ATTACHMENT_HOST : url.pathname.startsWith('/system/'))) {
event.respondWith(openSystemCache().then(cache => {
return cache.match(event.request.url).then(cached => {
if (cached === undefined) {
...
...
@@ -73,5 +73,5 @@ self.addEventListener('fetch', function(event) {
return cached;
});
}));
}
}
*/
});
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
register
or
sign in
to comment