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

Improve version information #701

Closed
Argafal opened this issue Feb 20, 2023 · 0 comments
Closed

Improve version information #701

Argafal opened this issue Feb 20, 2023 · 0 comments
Assignees
Labels

Comments

@Argafal
Copy link
Contributor

Argafal commented Feb 20, 2023

In the support chat earlier there was some confusion by a user which version they were using. They had misread the message on /index.

I agree that this message can be misread when one is not familiar with ahoy and its development cycles. Proposed change below. This patch includes some sort of version information every time and explicitly mentions which development version is being used (where applicable).

This patch also includes the suggestion by @beegee3 made in issue #660.


$ git diff
diff --git a/src/web/html/index.html b/src/web/html/index.html
index 3a1628b..c1c5560 100644
--- a/src/web/html/index.html
+++ b/src/web/html/index.html
@@ -219,7 +219,9 @@
                     if(getVerInt(version) < getVerInt(release))
                         p.append(svg(iconInfo, 20, 20, "#00d", "icon"), span("Update available, current released version: " + release), br());
                     else if(getVerInt(version) > getVerInt(release))
-                        p.append(svg(iconInfo, 20, 20, "#00d", "icon"), span("You are using a development version, current released version: " + release), br());
+                        p.append(svg(iconInfo, 20, 20, "#00d", "icon"), span("You are using development version " + version +". In case of issues you may want to try the current stable release: " + release), br());
+                                       else 
+                        p.append(svg(iconInfo, 20, 20, "#00d", "icon"), span("You are using the current stable release: " + release), br());
                 }
 
                 document.getElementById("warn_info").replaceChildren(p);
diff --git a/src/web/web.h b/src/web/web.h
index b8468bb..d26e7b5 100644
--- a/src/web/web.h
+++ b/src/web/web.h
@@ -190,7 +190,7 @@ class Web {
 
             msg.replace("\r\n", "<rn>");
             if(mSerialAddTime) {
-                if((9 + mSerialBufFill) <= WEB_SERIAL_BUF_SIZE) {
+                if((9 + mSerialBufFill) < WEB_SERIAL_BUF_SIZE) {
                     if(mApp->getTimestamp() > 0) {
                         strncpy(&mSerialBuf[mSerialBufFill], mApp->getTimeStr(mApp->getTimezoneOffset()).c_str(), 9);
                         mSerialBufFill += 9;
@@ -208,7 +208,7 @@ class Web {
                 mSerialAddTime = true;
 
             uint16_t length = msg.length();
-            if((length + mSerialBufFill) <= WEB_SERIAL_BUF_SIZE) {
+            if((length + mSerialBufFill) < WEB_SERIAL_BUF_SIZE) {
                 strncpy(&mSerialBuf[mSerialBufFill], msg.c_str(), length);
                 mSerialBufFill += length;
             }

@lumapu lumapu self-assigned this Feb 22, 2023
@lumapu lumapu added the fixed dev fixed label Feb 22, 2023
lumapu added a commit that referenced this issue Feb 22, 2023
webserial minor overflow fix #660
web `index.html` improve version information #701
fix MQTT sets power limit to zero (0) #692
changed `reset at midnight` with timezone #697
@lumapu lumapu closed this as completed Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants