Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Response incomplete #27

Open
barathibalamurugan opened this issue Jan 30, 2019 · 7 comments
Open

Response incomplete #27

barathibalamurugan opened this issue Jan 30, 2019 · 7 comments

Comments

@barathibalamurugan
Copy link

barathibalamurugan commented Jan 30, 2019

screenshot 2019-01-30 at 5 46 10 am

File 1

function ctiapisetCenter(id)
{ 
	document.getElementById(id).style.display="block";
	createFreezeLayer();
	$top = $(window).height()/2;
	$contop = $("#"+id).innerHeight()/2;
	$left = $(window).width()/2;
	$conleft = $("#"+id).width()/2;
	$("#"+id).css({'top': $top-$contop, 'left': $left-$conleft});
}
$(document).ready(function(){
	if($(".selector").length !==0 && typeof $.fn.sortable === "function"){
		$( ".selector" ).sortable( "disable" );
	}
}

File 2

Territory.showOrHideDelIcon = function(obj, option)
{
	$(obj).children('a').eq(0).toggle(option);
};
Territory.getCurrencyObj = function(sampleStr)
{
	var currencyDet = {};
	currencyDet.format = ',|.';
	currencyDet.decimals = 2;
	if(User.userDetails.BASE_CURRENCY && User.userDetails.CURRENCY_DETAILS[User.userDetails.BASE_CURRENCY])
	{
		currencyDet = User.userDetails.CURRENCY_DETAILS[User.userDetails.BASE_CURRENCY];
	}
	else if(User.userDetails.defaultOrgCurrency)
	{
		currencyDet.symbol = User.userDetails.defaultOrgCurrency;
	}			
	var quotaPercent,shortPercent;
	if(!currencyDet.symbol && sampleStr)
	{
		sampleStr = sampleStr.trim();
		var currency = sampleStr.match(/^.*?(?=[0-9])/);//No I18N
		currencyDet.symbol = currency[0];
	}
	return currencyDet;

Above two are the example code snippets script files after brotli compression. As you can see the functions were not completed.

@nitram509
Copy link
Contributor

@barathibalamurugan your description lacks contextual information and it's difficult to help you, when your config/setup is missing.
May I propose to read through the guideline https://github.com/magento/magento2/wiki/Issue-reporting-guidelines?
Especially, "preconditions" and "steps to reproduce" would be great to see, in your case.

PS: by looking at the files you posted, I just have a first gut-feeling, this has nothing to do with jbrotli. Since jbrotli has some known-issues (https://github.com/MeteoGroup/jbrotli/issues) but they seem not to match what you've posted so far.

@barathibalamurugan
Copy link
Author

Expected Result

$(document).ready(function(){
	if($(".selector").length !==0 && typeof $.fn.sortable === "function"){
		$( ".selector" ).sortable( "disable" );
	}
}):

As you can see the document.ready function is enclosed with "):" in the above snippet. But once the file compressed through brotli the response received without the closing braces for the document.ready function like below snippet.

Current Result

$(document).ready(function(){
	if($(".selector").length !==0 && typeof $.fn.sortable === "function"){
		$( ".selector" ).sortable( "disable" );
	}
}

it was working fine with gzip compression. Hope it clarifies.

@barathibalamurugan
Copy link
Author

barathibalamurugan commented Jan 30, 2019

@nitram509 I have an another query. Will the compression work for dynamic js files?

@nitram509
Copy link
Contributor

Thank you, I now know what you expect.

May I ask for your setup you use?

@barathibalamurugan
Copy link
Author

Sorry i'm not using git project. It just a machine setup which i can't share.

@nitram509
Copy link
Contributor

nitram509 commented Jan 30, 2019

I'm asking for your software setup/configuration.
What I'm trying to say, please re-read https://github.com/magento/magento2/wiki/Issue-reporting-guidelines ... Especially, "preconditions" and "steps to reproduce" would be great to see, in your case.

You're posting an issue on jbrotli, which is a Java library.
So, I assume, you have configured and programmed it somewhere.
I'm interested in that part.
What version?
What Operation System?
What way of using it?
How configured?
etc.

PS: think about: if you ask Volkswagen: "my Volkswagen doesn't work." -- They want to know more details about the car model you're using, right ;)

@barathibalamurugan
Copy link
Author

Okay.

OS : macOS Mojave
Version : 10.14

Added libbrotli.dylib under JAVA_HOME/jre/lib

I've configured the jbrotli files as used in the git project of yours.

"org/meteogroup/jbrotli"
Other than BrotliFilter file all the files of jbrotli was added in the above folder.

screenshot 2019-01-31 at 12 14 47 pm

compiled classes
screenshot 2019-01-31 at 12 17 41 pm

<filter>
		<filter-name>BrotliFilter</filter-name>
		<filter-class>filter.BrotliFilter</filter-class>
		<init-param>
			<param-name>exclude</param-name>
			<param-value>/.*\.png|/.*\.jpg|/.*\.gif|/.*\.woff|/.*\.ttf|/.*\.svg|.*\.eot|/.*\.ico|/.*\.txt</param-value>
		</init-param>
</filter>
-----
<filter-mapping>
		<filter-name>BrotliFilter</filter-name>
		<url-pattern>/*</url-pattern>
/filter-mapping>

BrotliFilter
brotlifilter.txt

Please let me know any other info is needed.

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

No branches or pull requests

2 participants