Giter VIP home page Giter VIP logo

Comments (16)

yurikuzn avatar yurikuzn commented on May 27, 2024

What do you mean by 'memory leak'. I tried on two instances, the "Saved" alert appeared. It does not appear for you? What exactly happens?

from espocrm.

zhuyicheng666 avatar zhuyicheng666 commented on May 27, 2024

My chrome will be frozon and nothing responds when I click on anything。

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

Any JS errors in the browser console?

from espocrm.

zhuyicheng666 avatar zhuyicheng666 commented on May 27, 2024

no。Chrome has frozen due to an infinite loop.

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

Strange. I'll try to figure out but the fact that I can't reproduce complicate things. Does it happen only if you change the label or happens if you change any parameter?

Could you point where exactly the loop happens?

from espocrm.

zhuyicheng666 avatar zhuyicheng666 commented on May 27, 2024

When I add this.off('sync'); in the function load which in the client/src/languages and the problem has solved. The whole function is

 load(callback, disableCache, loadDefault) {
        this.off('sync');
        if (callback) {
            this.once('sync', callback);
        }

        if (!disableCache) {
            if (this.loadFromCache(loadDefault)) {
                this.trigger('sync');

                return new Promise(resolve => resolve());
            }
        }

        return new Promise(resolve => {
            this.fetch(loadDefault)
                .then(() => resolve());
        });
    }

the loop i think is about 'sync' event.

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

Thanks for info. Do you have any custom code that calls the load method of the language object?

from espocrm.

zhuyicheng666 avatar zhuyicheng666 commented on May 27, 2024

No custom code. I set 'useCache' => true in data/config.php and use production mode.

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

I checked the whole codebase and have not found the 'sync' event being used on the language object. The 'callback' is never passed (it's deprecated). No idea why this happens on your instance. I might add the 'off' for v8.2 hotfix, but need to refactor the method for the future versions so that only promise is used.

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

bfed154

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

It's not related. It's another object.

from espocrm.

zhuyicheng666 avatar zhuyicheng666 commented on May 27, 2024

In client\src\views\site\navbar.js

this.listenTo(this.getHelper().language, 'sync', () => update());

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

This could be a reason.

EDIT. Unlikely. It should not prevent 'sync' from firing.

from espocrm.

zhuyicheng666 avatar zhuyicheng666 commented on May 27, 2024

maybe something wrong where excuting '() => update()' .because if not removing the listener on language, it may add a same one on it when update()

from espocrm.

yurikuzn avatar yurikuzn commented on May 27, 2024

Yes. It's possible that code fails within update() execution, and then not proceeded to return new Promise(resolve => resolve()); in the load method. But usually it should be seen in the console.

from espocrm.

eymen-elkum avatar eymen-elkum commented on May 27, 2024

@zhuyicheng666 do you have 3rd party extensions

from espocrm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.