Update to pass product from client back to ArtifactUpdate

This commit is contained in:
Seth Call 2023-09-02 15:23:22 -05:00
parent 21733110f4
commit fc9d69f5f9
4 changed files with 21 additions and 19 deletions

View File

@ -43,8 +43,8 @@ module JamRuby
Notification.send_client_update(product, version, determine_url, size)
end
def self.find_client_by_os(os, environment=DEFAULT_ENVIRONMENT)
ArtifactUpdate.find_by_product_and_environment("#{CLIENT_PREFIX_MODERN}/#{os}", environment)
def self.find_client_by_os(product, os, environment=DEFAULT_ENVIRONMENT)
ArtifactUpdate.find_by_product_and_environment("#{product}/#{os}", environment)
end
def determine_url

View File

@ -833,6 +833,7 @@
client_id: client_id,
machine: machine,
os: os,
product: 'JamClientModern',
//jamblaster_serial_no: context.PlatformStore.jamblasterSerialNo(),
udp_reachable: context.JK.StunInstance
? !context.JK.StunInstance.sync()

View File

@ -18,7 +18,7 @@
function cancelUpdate(e) {
if ((e.ctrlKey || e.metaKey) && e.keyCode == 78) {
logger.debug("update canceled!");
console.log("update canceled!");
app.layout.closeDialog('client-update');
app.clientUpdating = false;
}
@ -82,7 +82,7 @@
/***************************************/
function clientUpdateDownloadProgress(bytesReceived, bytesTotal, downloadSpeedMegSec, timeRemaining) {
// this fires way too many times to leave in. uncomment if debugging update feature
//logger.debug("bytesReceived: " + bytesReceived, ", bytesTotal: " + bytesTotal, ", downloadSpeed: " + downloadSpeedMegSec, ", timeRemaining: " + timeRemaining + ", updateSize: " + updateSize);
//console.log("bytesReceived: " + bytesReceived, ", bytesTotal: " + bytesTotal, ", downloadSpeed: " + downloadSpeedMegSec, ", timeRemaining: " + timeRemaining + ", updateSize: " + updateSize);
bytesReceived = Number(bytesReceived)
bytesTotal = Number(bytesTotal)
@ -93,7 +93,7 @@
}
function clientUpdateDownloadSuccess(updateLocation) {
logger.debug("client update downloaded successfully to: " + updateLocation);
console.log("client update downloaded successfully to: " + updateLocation);
updateClientUpdateDialog("update-proceeding");
@ -117,7 +117,7 @@
userTimeToRead = 1000; // older clients didn't pass this in, and exit very quickly
}
logger.debug("client update launching in: " + userTimeToRead);
console.log("client update launching in: " + userTimeToRead);
// set timer to update countdown
var rounded = Math.round(userTimeToRead / 1000);
@ -145,7 +145,7 @@
}
function clientUpdateLaunchStatuses(statuses) {
logger.debug("client update launch statuses");
console.log("client update launch statuses");
if (statuses) {
for (var i = 0; i < statuses.length; i++) {
@ -155,7 +155,7 @@
}
function clientUpdateLaunchStatusChange(done, status) {
logger.debug("client update launch status change. starting=" + done + ", status=" + status);
console.log("client update launch status change. starting=" + done + ", status=" + status);
if (!done) {
var $ellipses = $('<span class="ellipses">.</span>');
@ -203,14 +203,14 @@
async function runCheck(product, version, uri, size, currentVersion) {
if (app.clientUpdating) {
logger.debug("client is already updating; skipping")
console.log("client is already updating; skipping")
return
}
logger.debug("runCheck: product , version", product, version)
console.log("runCheck: product , version", product, version)
// check kill switch before all other logic
if (!gon.check_for_client_updates) {
logger.debug("runCheck: skipping client update because the server is telling us not to")
console.log("runCheck: skipping client update because the server is telling us not to")
return;
}
@ -218,7 +218,7 @@
currentVersion = await context.jamClient.ClientUpdateVersion() //.then(function(currentVersion){
if (!forceShow && (currentVersion == null || currentVersion.indexOf("Compiled")) > -1) {
// this is a developer build; it doesn't make much sense to do an packaged update, so skip
logger.debug("skipping client update check because this is a development build ('" + currentVersion + "')")
console.log("skipping client update check because this is a development build ('" + currentVersion + "')")
return;
}
@ -239,7 +239,7 @@
updateSize = size;
if(context.SessionStore.inSession()) {
logger.debug("deferring client update because in session")
console.log("deferring client update because in session")
return;
}
@ -266,7 +266,7 @@
// check kill switch before all other logic
if (!gon.check_for_client_updates) {
logger.debug("skipping client update because the server is telling us not to")
console.log("skipping client update because the server is telling us not to")
return;
}
@ -276,7 +276,7 @@
if (!forceShow && (currentVersion == null || currentVersion.indexOf("Compiled")) > -1) {
// this is a developer build; it doesn't make much sense to do an packaged update, so skip
logger.debug("skipping client update check because this is a development build ('" + currentVersion + "')")
console.log("skipping client update check because this is a development build ('" + currentVersion + "')")
return;
}
@ -300,7 +300,7 @@
}
async function startDownload(url) {
logger.debug("starting client updater download from: " + url);
console.log("starting client updater download from: " + url);
updateClientUpdateDialog("update-downloading")
@ -311,7 +311,7 @@
}
async function startUpdate(updaterFilePath) {
logger.debug("starting client update from: " + updaterFilePath)
console.log("starting client update from: " + updaterFilePath)
await context.jamClient.ClientUpdateStartUpdate(updaterFilePath,
"JK.ClientUpdate.LaunchUpdateSuccessCallback",

View File

@ -792,6 +792,7 @@ module JamWebsockets
client_type = options["client_type"]
machine_fingerprint = options["machine"]
os = options["os"]
product = options["product"].nil? ? JamRuby::ArtifactUpdate::CLIENT_PREFIX : options['product']
udp_reachable = options["udp_reachable"].nil? ? true : options["udp_reachable"] == 'true'
jamblaster_serial_no = options["jamblaster_serial_no"]
ipv4_link_local = options["ipv4_link_local"]
@ -1000,7 +1001,7 @@ module JamWebsockets
puts "O/S = #{os}"
puts "========================="
# if we have OS data, try to grab client update data and let the client have it
update = ArtifactUpdate.find_client_by_os(os) if client_type == Connection::TYPE_CLIENT && os
update = ArtifactUpdate.find_client_by_os(product, os) if client_type == Connection::TYPE_CLIENT && os
client_update = update.update_data if update
@ -1050,7 +1051,7 @@ module JamWebsockets
end
end
# if we have OS data, try to grab client update data and let the client have it
update = ArtifactUpdate.find_client_by_os(os) if client_type == Connection::TYPE_CLIENT && os
update = ArtifactUpdate.find_client_by_os(product, os) if client_type == Connection::TYPE_CLIENT && os
client_update = update.update_data if update