Open Haarolean opened 6 months ago
Unfortunately, I couldn't find a way to work around this by determining installation owner's account type, please let me know if there's something I missed
UPD: Found a workaround:
ghInstallation.getRoot().setConnector(HttpConnector.OFFLINE);
ghInstallation.getAccount().getType();
Here's the problem:
populate()
should only be called if type
is null.
@bitwiseman got it. How should we solve this taking into consideration the fact that there are multiple fields like this? Should we track the "populated = true/false" flag for an entity or something else?
@bitwiseman bump?
@Haarolean
In this specific case, you can guard the populate()
call with if (type == null)
.
I think some of the classes have a populate(bool doPopulate)
method or populate(Object objectToCheckForNullValue)
to streamline this process.
Tracking bool isPopulated;
as field could also work.
I don't like the way we currently don't know what fields we have actually loaded in an instance, but I haven't had time to ponder a better solution for the range partial fields that are returned. Maybe have the base record and then use interfaces to show what fields are present.
What are your thoughts?
Hi, a code like this
leads to 401:
There are a few issues here:
getAccount()
, so populating here is not necessary, perhaps.installation.getAccount().getUrl()
returnshttps://api.github.com/users/<ORGANIZATION_LOGIN>
, which perhaps is invalid, because it's an organization, not a user.