Skip to content

Commit

Permalink
Merge pull request #529 from magento-performance/ACPT-1184
Browse files Browse the repository at this point in the history
ACPT-1184: Fix classes found by GraphQlStateTest
  • Loading branch information
andimov authored May 10, 2023
2 parents 405eb07 + 121046a commit afd29e2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,21 @@
Magento\Framework\GraphQl\Query\Fields::class => null,
],
'*' => [
Magento\Framework\Webapi\Response::class => null,
Magento\TestFramework\App\Filesystem::class => null,
Magento\TestFramework\Interception\PluginList::class => null,
// memory leak, wrong sql, potential issues
Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Deferred\Product::class => null,
Magento\ConfigurableProductGraphQl\Model\Variant\Collection::class => null,
Magento\ConfigurableProductGraphQl\Model\Options\Collection::class => null,
Magento\Framework\Url\QueryParamsResolver::class => null,
Magento\Framework\Event\Config\Data::class => null, // TODO: reset when config is reset from poison pill
Magento\Framework\Event\Config\Data::class => null,
Magento\Framework\App\AreaList::class => null,
'customRemoteFilesystem' => null,
Magento\Store\App\Config\Type\Scopes::class => null,
Magento\Framework\Module\Dir\Reader::class => null,
Magento\Framework\App\Language\Dictionary::class => null,
Magento\Framework\Code\Reader\ClassReader::class => null,
Magento\Framework\ObjectManager\ConfigInterface::class => null,
Magento\Framework\App\Cache\Type\Config::class => null,
Magento\Framework\Interception\PluginListGenerator::class => null,
Magento\TestFramework\App\Config::class => null,
Magento\TestFramework\Request::class => null,
Magento\Framework\View\FileSystem::class => null,
Magento\Framework\App\Config\FileResolver::class => null,
Magento\Framework\Module\Manager::class => null,
Magento\Framework\Logger\LoggerProxy::class => null,
Magento\TestFramework\ErrorLog\Logger::class => null,
'translationConfigSourceAggregated' => null,
Magento\Framework\App\Request\Http\Proxy::class => null,
Expand All @@ -67,40 +58,28 @@
Magento\Framework\Locale\Resolver\Proxy::class => null,
Magento\MediaStorage\Helper\File\Storage\Database::class => null,
Magento\Framework\App\Cache\Proxy::class => null,
Magento\Framework\Translate::class => null, // TODO: ?
Magento\Store\Model\StoreManager::class => null, // TODO: This is reset with poison pill, right?
Magento\Framework\App\Http\Context::class => null, // TODO: This should probably be cleaned up, right?!?
Magento\Customer\Model\Session\Storage::class => null, // TODO: Didn't Aakash or Kasian fix this already?
Magento\TestFramework\Response::class => null, // TODO: Why is this in the ObjectManager?!?
Magento\Store\Model\WebsiteRepository::class => null, // TODO: What is going on here?!?
Magento\Framework\Locale\Resolver::class => null, // TODO: do we need to fix this?
Magento\Theme\Model\ResourceModel\Theme\Collection::class => null, // TODO
Magento\Store\Model\GroupRepository::class => null, // TODO: see what this is
Magento\Store\Model\StoreRepository::class => null, // TODO: could be fixed already with Poison Pill
Magento\Framework\View\Design\Fallback\RulePool::class => null, // TODO: Looks like we need to reset?
Magento\Framework\View\Asset\Repository::class => null, // TODO: Looks okay, but need to confirm
Magento\Framework\HTTP\Header::class => null, // TODO: I believe Aakash is currently working on this
Magento\Framework\App\Route\Config::class => null, // TODO: reset when Poison Pill causes config to reset.
Magento\Customer\Model\ResourceModel\Attribute::class => null, // TODO
Magento\Framework\DataObject\Copy\Config\Converter::class => null, // TODO
Magento\Framework\DataObject\Copy\Config\SchemaLocator::class => null, // TODO
Magento\Framework\DataObject\Copy\Config\Reader::class => null, // TODO
Magento\Framework\DataObject\Copy\Config\Data::class => null, // TODO
Magento\Store\Model\System\Store::class => null, // TODO
Magento\AwsS3\Driver\CredentialsCache::class => null, // TODO
Magento\Eav\Model\Config::class => null, // TODO: Does this work properly after config changes?
'AssetPreProcessorPool' => null, // TODO: see what this is
Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider::class => null, // FIXME: bug?
Magento\GraphQl\Model\Query\Context::class => null, // FIXME: I think this one needs to be reset. Check!
Magento\GraphQl\Model\Query\ContextFactory::class => null, // FIXME: I think this one needs to be reset. Check!
'viewFileMinifiedFallbackResolver' => null, // FIXME: remove after fix for Framework\View\Asset\Minification
Magento\Framework\View\Asset\Minification::class => null, // FIXME: $configCache must be reset
// FIXME: We MUST NOT dependency inject collections.
// This needs to be fixed in Magento\CatalogGraphQl\Model\Config\SortAttributeReader
Magento\Framework\Translate::class => null,
Magento\Store\Model\StoreManager::class => null,
Magento\Framework\App\Http\Context::class => null,
Magento\TestFramework\Response::class => null,
Magento\Store\Model\WebsiteRepository::class => null,
Magento\Framework\Locale\Resolver::class => null,
Magento\Store\Model\GroupRepository::class => null,
Magento\Store\Model\StoreRepository::class => null,
Magento\Framework\View\Design\Fallback\RulePool::class => null,
Magento\Framework\View\Asset\Repository::class => null,
Magento\Framework\HTTP\Header::class => null,
Magento\Framework\App\Route\Config::class => null,
Magento\Store\Model\System\Store::class => null,
Magento\AwsS3\Driver\CredentialsCache::class => null,
Magento\Eav\Model\Config::class => null,
'AssetPreProcessorPool' => null,
Magento\GraphQl\Model\Query\ContextFactory::class => null,
'viewFileMinifiedFallbackResolver' => null,
Magento\Framework\View\Asset\Minification::class => null,
Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null,
Magento\Framework\Url::class => null, // FIXME: This need reseter!!
Magento\Quote\Model\Quote\Address\Total\Collector::class => null, // FIXME: mutable state that needs to be reset
Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null, // FIXME: caching from $request
Magento\Framework\Url::class => null,
Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null,
],
'' => [
],
Expand Down
9 changes: 8 additions & 1 deletion lib/internal/Magento/Framework/Translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Filesystem\Driver\File;
use Magento\Framework\Filesystem\DriverInterface;
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;

/**
* Translate library
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
*/
class Translate implements \Magento\Framework\TranslateInterface
class Translate implements \Magento\Framework\TranslateInterface, ResetAfterRequestInterface
{
const CONFIG_AREA_KEY = 'area';
const CONFIG_LOCALE_KEY = 'locale';
Expand Down Expand Up @@ -601,4 +602,10 @@ private function getSerializer()
}
return $this->serializer;
}

public function _resetState(): void
{
$this->_config = [];
$this->_data = [];
}
}

0 comments on commit afd29e2

Please sign in to comment.