Truncated JavaScript code in plugins | ThingSpeak Plugins | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Truncated JavaScript code in plugins
Avatar
nr

Silver
Forum Posts: 7
sp_UserOfflineSmall Offline
1
January 4, 2014 - 6:39 am
sp_Permalink sp_Print

I just discovered that my two plugins are not working anymore - without me doing any changes to them. When inspecting the source, it appears that the JavaScript code has somehow been truncated, and when going to edit mode, I can also only see incomplete code.
Has anybody else experienced something similar?

nr

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
2
January 5, 2014 - 4:50 pm
sp_Permalink sp_Print

Hi,

We don't truncate any of the JavaScript code from our side, it can be as long as you want. Other plugins are working correctly on our system. It seems that your two plugins were edited recently on Dec 26 and Dec 29. Could you have accidentally edited them, or updated them using a (mobile?) device that truncated the data sent to our servers?

lee

Avatar
nr

Silver
Forum Posts: 7
sp_UserOfflineSmall Offline
3
January 6, 2014 - 7:30 pm
sp_Permalink sp_Print

I haven't touched any of the plugins for several days (Dec 26/29 sounds about right), and at least one of them was working nicely until the day before yesterday. The JavaScript code for both plugins appear to have been truncated at the same position - making it quite an odd coincidence.

Anyway, thanks for the feedback, lee.
Apart from being puzzling, there's no harm done. I'll just insert the code again.

nr

Avatar
whahoo
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
4
February 3, 2014 - 4:35 am
sp_Permalink sp_Print

Hi,
I have had the same thing, on my plugin https://api.thingspeak.com/plugins/2253
It stopped working in the last month or so, but i have only just come back to see what the problem is. I haven't logged into the thinkspeak site for many months so it wasn't an edit from me.

I don't seem to have a copy of what i had in it, (my bad) but you might want to check how this could have happened, data loss bugs are bad!

Thanks,
Simon

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
5
February 3, 2014 - 12:09 pm
sp_Permalink sp_Print

Hi Simon,

I think I figured out the problem with some of the data being truncated. In order to better support our international users, we recently switched some of our database tables over to UTF8, and in the process some irregular characters may have caused the data immediately after them to be lost. Do you remember if you had any non-alphanumeric characters (perhaps right after the "Temp") in your code? I apologize for the data loss, but now that the tables have been converted to UTF8 it shouldn't happen again.

lee

Avatar
nr

Silver
Forum Posts: 7
sp_UserOfflineSmall Offline
6
February 3, 2014 - 2:50 pm
sp_Permalink sp_Print

Simon, thanks for posting and backing me.

I checked against the original code and can confirm that the JavaScript code in my two plugins was in fact truncated at the location of a non-alphanumeric character (the degree symbol, Unicode U+00B0). Thanks for solving the puzzle, lee.

nr

Avatar
kulgan
France

Silver
Forum Posts: 9
sp_UserOfflineSmall Offline
7
February 4, 2014 - 12:12 pm
sp_Permalink sp_Print sp_EditHistory

Hi,

Same problem for me. I have 8 active plugins.
Four of them are truncated and i haven't edited them since a long time.
Plugins : 1231,3905,3906,3907
Like this one :

body {
background-color: #FFF;
}

var chart;
var charts;
var data;

google.load('visualization', '1', {
packages: ['gauge']
});
google.setOnLoadCallback(initChart);

function displayData(point) {

var conso

var dt = new Date();
var sec = (dt.getHours() * 3600) + (dt.getMinutes() * 60) + dt.getSeconds();
if ((sec > 23400) && (sec < 81000)) {
// Heures pleines 06:30 a 22:30
conso = point * 0.0001353;
// data.setValue(0, 0, '

French

Use Zibase Box

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
8
February 4, 2014 - 2:37 pm
sp_Permalink sp_Print

Hi Kulgan,

This was likely due to non-alphanumeric characters in your code, which caused data to be truncated when we converted our tables to UTF8. We apologize for the problems this caused.

lee

Avatar
kulgan
France

Silver
Forum Posts: 9
sp_UserOfflineSmall Offline
9
February 6, 2014 - 11:22 am
sp_Permalink sp_Print sp_EditHistory

Cry

Thank you for the solution, but is it possible to have the original script?
Because I would prefer not to spent 2 hours to rewrite my code, if possible!

French

Use Zibase Box

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
10
February 6, 2014 - 12:05 pm
sp_Permalink sp_Print

Unfortunately we can't retrieve the original script.

lee

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

dannymm1

KamorkasOr

GRV2903

Jusikaclaiz

Raymondpoers

ScottDus

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee