зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1659407 - Remove newCacheStructure webconsole trait. r=ladybenko.
Differential Revision: https://phabricator.services.mozilla.com/D87234
This commit is contained in:
Родитель
3454e7652e
Коммит
4024f7b515
|
@ -196,8 +196,6 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
}
|
||||
|
||||
this.traits = {
|
||||
// Supports new cached messages structure for 77+
|
||||
newCacheStructure: true,
|
||||
// Supports retrieving blocked urls
|
||||
blockedUrls: true,
|
||||
};
|
||||
|
|
|
@ -43,29 +43,13 @@ module.exports = async function({
|
|||
// /!\ The actor implementation requires to call startListeners("PageError") first /!\
|
||||
let { messages } = await webConsoleFront.getCachedMessages(["PageError"]);
|
||||
|
||||
// On older server (< v77), we're also getting LogMessage cached messages, so we need
|
||||
// to ignore those.
|
||||
// On server < v79, we're also getting CSS Messages that we need to filter out.
|
||||
messages = messages.filter(message => {
|
||||
return (
|
||||
(webConsoleFront.traits.newCacheStructure ||
|
||||
!message._type ||
|
||||
message._type == "PageError") &&
|
||||
message.pageError.category !== MESSAGE_CATEGORY.CSS_PARSER
|
||||
);
|
||||
});
|
||||
messages = messages.filter(
|
||||
message => message.pageError.category !== MESSAGE_CATEGORY.CSS_PARSER
|
||||
);
|
||||
|
||||
messages = messages.map(message => {
|
||||
// Handling cached messages for servers older than Firefox 78.
|
||||
// Wrap the message into a `pageError` attribute, to match `pageError` behavior
|
||||
if (message._type) {
|
||||
return {
|
||||
pageError: message,
|
||||
resourceType: ResourceWatcher.TYPES.ERROR_MESSAGE,
|
||||
};
|
||||
}
|
||||
messages.forEach(message => {
|
||||
message.resourceType = ResourceWatcher.TYPES.ERROR_MESSAGE;
|
||||
return message;
|
||||
});
|
||||
// Cached messages don't have the same shape as live messages,
|
||||
// so we need to transform them.
|
||||
|
|
|
@ -29,19 +29,7 @@ module.exports = async function({ targetList, targetFront, onAvailable }) {
|
|||
|
||||
// Fetch already existing messages
|
||||
// /!\ The actor implementation requires to call startListeners("PageError") first /!\
|
||||
// On older server (< v77), cached messages have to be retrieved at the same time as
|
||||
// PageError messages.
|
||||
let { messages } = await webConsoleFront.getCachedMessages([
|
||||
webConsoleFront.traits.newCacheStructure ? "LogMessage" : "PageError",
|
||||
]);
|
||||
|
||||
// On older server (< v77), we're also getting pageError cached messages, so we need
|
||||
// to ignore those.
|
||||
messages = messages.filter(message => {
|
||||
return (
|
||||
webConsoleFront.traits.newCacheStructure || message._type === "LogMessage"
|
||||
);
|
||||
});
|
||||
const { messages } = await webConsoleFront.getCachedMessages(["LogMessage"]);
|
||||
|
||||
for (const message of messages) {
|
||||
// Handling cached messages for servers older than Firefox 78.
|
||||
|
|
Загрузка…
Ссылка в новой задаче