Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[general] Prevent api change #467

Draft
wants to merge 3 commits into
base: releaseCandidate
Choose a base branch
from

Conversation

hakeemsalman
Copy link

@hakeemsalman hakeemsalman commented Jun 27, 2024

Describe your changes

  1. Added warning at the bottom of the display popup. When you change the API version beyond the current release version, it will give alert.

#464 issue number and LINK

Checklist before requesting a review

  • [x ] I have read and understand the Contributions section
  • Target branch is releaseCandidate and not master
  • I have performed a self-review of my code
  • I ran the unit tests and my PR does not break any tests
  • I documented the changes I've made on the CHANGES.md and followed actual conventions
  • I added a new section on how-to.md (optional)

@tprouvot
Copy link
Owner

Hi @hakeemsalman,
Thanks for the PR !

If the user did not visited the Org tab he can't update the api version:

2024-06-28_10-19-59 (1)

Today the apiVersion setting is not org specific and it can be an issue since the latest api version is not always the same depending on the environment you are.
If we implement a version check, we have to set this setting org specific (prefixed with the sfHost).

Let me expose how I see it:

  • When the popup opens and the session settings are not populated, we trigger the api call made for the org tab to gather the information (and store them also in session setting) and the latest api version (org specific).
  • For the org tab we use the stored setting instead of the api call
  • We use the the input max attribute for the api version input to limit the max number
  • We also use the max input in the option page where we can also set the api version
  • Update the default API version to 61 since all env are on this one now
    export let apiVersion = localStorage.getItem("apiVersion") == null ? "61.0" : localStorage.getItem("apiVersion");
  • Make the apiVersion setting org specific
  • (Optional) delete apiVersion setting in background.js when the extension will update
chrome.runtime.onInstalled.addListener(({reason}) => {
  if (reason === "install") {
    chrome.tabs.create({
      url: "https://tprouvot.github.io/Salesforce-Inspector-reloaded/welcome/"
    });
  } else if (reason === "update") {
    //delete localStorage 'apiVersion' which is not used anymore and became org specific
    localStorage.removeItem("apiVersion");
  }
});

@tprouvot tprouvot changed the title Prevent api change [general] Prevent api change Jul 1, 2024
@tprouvot
Copy link
Owner

Hi @hakeemsalman,
Did you had a chance to review my comments ?

@hakeemsalman
Copy link
Author

Hi @tprouvot,

I apologize for the late response. I was busy with work and learning this Chrome extension and code. I appreciate your feedback and will address the issues as soon as possible. I am still in the learning stage and eager to improve.

Thank you for your understanding.

Best regards,
Salman.

@tprouvot tprouvot marked this pull request as draft August 21, 2024 09:38
@hakeemsalman
Copy link
Author

hakeemsalman commented Aug 29, 2024

Hi @tprouvot,

I hope you're doing well.

Thank you for your patience. I’ve been focused on learning and refining the code. I've been in learning the React.js and I'm making progress. I'm currently working on understanding and fixing the issues you mentioned. I’ve made progress on the input max attribute issue as described. However, I need a bit more clarification on implementing the API storage and session settings.

Specifically, could you please provide more details or hints on how to properly store the API data when the popup opens and the session settings are not populated? I’d like to understand better how to trigger the API call for the org tab and use the stored settings efficiently.

Any additional explanation or examples would be very helpful.

Thank you for your continued support.

Best regards,
@hakeemsalman

@tprouvot
Copy link
Owner

You can check the request made on Organization to store the isSandbox local property, basically you do the same query that is made on the orgTab and store the result in a session storage

@hakeemsalman
Copy link
Author

Thank you for giving the inputs. I will work on that and update the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants