Comments (6)
Hi @dannysummerlin and all,
I believe I have a fix for this issue. Can't add a PR as I'm not a collaborator, but hopefully this will help:
As I understand it, due to race condition, the new createSObjectCommands() function that runs in the background, sometimes has no access to forceNavigator.serverUrl (as this value is set in the contentScript).
To fix it, I passed the value of serverUrl in the "getMetaData" message, in a similar way apiUrl and other values are passed.
The result is that the error is not happening anymore.
The changes are:
background.js:
const parseMetadata = (data, url, settings, serverUrl = {})=>{ <----------
if (data.length == 0 || typeof data.sobjects == "undefined") return false
let mapKeys = Object.keys(forceNavigator.objectSetupLabelsMap)
return data.sobjects.reduce((commands, sObjectData) => forceNavigator.createSObjectCommands(commands, sObjectData, serverUrl), {})
}
shared.js:
"createSObjectCommands": (commands, sObjectData, serverUrl) => { <----------
const { labelPlural, label, name, keyPrefix } = sObjectData
const mapKeys = Object.keys(forceNavigator.objectSetupLabelsMap)
if (!keyPrefix || forceNavigatorSettings.skipObjects.includes(keyPrefix)) { return commands }
let baseUrl = ""
if (forceNavigatorSettings.lightningMode && name.endsWith("__mdt")) { baseUrl += "/lightning/setup/CustomMetadata/page?address=" }
commands[keyPrefix + ".list"] = {
"key": keyPrefix + ".list",
"url": `${baseUrl}/${keyPrefix}`,
"label": t("prefix.list") + " " + labelPlural
}
commands[keyPrefix + ".new"] = {
"key": keyPrefix + ".new",
"url": `${baseUrl}/${keyPrefix}/e`,
"label": t("prefix.new") + " " + label
}
if(forceNavigatorSettings.lightningMode) {
let targetUrl = serverUrl + "/lightning/setup/ObjectManager/" + name <----------
mapKeys.forEach(key=>{
commands[keyPrefix + "." + key] = {
"key": keyPrefix + "." + key,
"url": targetUrl + forceNavigator.objectSetupLabelsMap[key],
"label": [t("prefix.setup"), label, t(key)].join(" > ")
}
})
} else {
// TODO maybe figure out how to get the url for Classic
commands[t("prefix.setup") + label] = { "url": keyPrefix, "key": key}
}
return commands
"loadCommands": (settings, force = false) => {
if(!forceNavigator.serverInstance || (!forceNavigatorSettings.sessionIdDisabled && [forceNavigator.sessionId, forceNavigator.organizationId].includes(null))) {
return forceNavigator.init()
}
if(force || Object.keys(forceNavigator.commands).length === 0)
forceNavigator.resetCommands()
if(!forceNavigatorSettings.sessionIdDisabled) {
let options = {
"sessionHash": forceNavigator.sessionHash,
"domain": forceNavigator.serverInstance,
"apiUrl": forceNavigator.apiUrl,
"key": forceNavigator.organizationId,
"force": force,
"sessionId": forceNavigator.sessionId,
"serverUrl" : forceNavigator.serverUrl, <----------
"action": "getMetadata"
}
-Uri
from force-navigator.
@uris-tools thanks for taking a look! I'm out and about today, but in the mean time you can fork the repo, make your edit, and then do a pull request, that will help keep track and highlight the exact changes even better - you only need to be a collaborator to give approval on a PR, but anyone can make one!
from force-navigator.
I'm getting the same
from force-navigator.
Also getting the same. Not sure if it was from the extension update, or my org moving to winter 24 as they both happened on the same date.
from force-navigator.
Same here
from force-navigator.
Encountered the same error.
from force-navigator.
Related Issues (20)
- Sorting Flows in search
- Navigating to "Profiles" (Setup > Manage Users > Profiles) leads user to dead link/404 page HOT 1
- Firefox - Issue with "All Sites" shortcut HOT 1
- Global Search not working HOT 1
- Navigator Bar is not working HOT 3
- update Firefox extension to 2.8.1
- need to still handle the retrieve parseSetup menu data to swap in Lightning references HOT 1
- Lightning Links no longer available or working HOT 9
- Clean up repetitive key in commands object
- Feature request: Option to open currently open record in classic and vice versa HOT 1
- Automatically close the popup search bar when clicking the overlay HOT 1
- Re issue 24, links still redirecting to classic. HOT 13
- Navigator Bar does not work in specific org HOT 2
- Issue still persistent. Works in dev org with more security settings, but not in sandbox/production with less security settings. Both use enhanced domain HOT 4
- Setup menu options missing HOT 1
- Missing urls HOT 3
- Chrome extension "Salesforce Navigator for Lightning" not working for some orgs HOT 9
- Error when opening creating clicking the 'new' button after using the shortcut with custom objects
- repo formatting alignment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from force-navigator.